# Accessing variables in a connector

**URL:** <https://meta.discourse.org/t/accessing-variables-in-a-connector/141747>\
**Category:** Development\
**Created:** [16 בפברואר,‏ 2020,‏ 4:40pm UTC](https://meta.discourse.org/t/accessing-variables-in-a-connector/141747 "2020-02-16T16:40:05Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [16 בפברואר,‏ 2020,‏ 4:40pm UTC](https://meta.discourse.org/t/accessing-variables-in-a-connector/141747/1 "2020-02-16T16:40:05Z")

</div>

I’m great at system administration. I’m not bad at doing stuff in rails. With javascript, ember, and CSS,I am just a caveman.

In a plugin that changes who can send PMs, I am trying to add a button to the profile page when the user does not have permission to send a PM. I can add text right where I want it by putting stuff in `assets/javascripts/discourse/templates/connectors/user-summary-stat/my-clever-name.hbs`. (There was much rejoicing!).

I see that [https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/templates/user/messages.hbs#L3](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/templates/user/messages.hbs#L3) uses

```plaintext
    {{#if showNewPM}}

```

I’d like to use that in `my-clever-name.hbs`, but that variable isn’t defined.

I think that maybe I need to create a `my-clever-name.js.es6` in the same directory as my `hbs` file and include . . . something, and/or add some code that defines that variable so that I can access it, but I’ve re-read the developer’s guide a few times as well as tried to mimic code in some plugins that seem like they’re doing the same, but don’t see just how to do that.

---

_[View the full topic](https://meta.discourse.org/t/accessing-variables-in-a-connector/141747)._
