# Dynamic Templates for plugin-outlet UIs

**URL:** https://meta.discourse.org/t/dynamic-templates-for-plugin-outlet-uis/59786
**Category:** Development
**Created:** [March 23, 2017, 5:57pm UTC](https://meta.discourse.org/t/dynamic-templates-for-plugin-outlet-uis/59786 "2017-03-23T17:57:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mandarbapaye](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@mandarbapaye](https://meta.discourse.org/u/mandarbapaye)
#### Post date: [March 23, 2017, 5:57pm UTC](https://meta.discourse.org/t/dynamic-templates-for-plugin-outlet-uis/59786/1 "2017-03-23T17:57:31Z")

</div>

Hi All

I am trying to extend the discourse UI by leveraging the plugin-outlets. Currently trying to add a custom header on top of the discourse header by leveraging ‘above-site-header’ plugin-outlet. I would like to make this template dynamic based on the logged in user. I am not able to figure out which ember controller backs up the plugin-outlet templates. I would really appreciate if someone could point me in the right direction on this one. (I tried ApplicationController as the outlet sits in application.hbs, but no luck).

Thanks  
Mandar

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [March 23, 2017, 6:10pm UTC](https://meta.discourse.org/t/dynamic-templates-for-plugin-outlet-uis/59786/2 "2017-03-23T18:10:17Z")

</div>

As of our latest stable release, outlets can only receive access to the parameters passed into them, so you can’t access controller methods.

Instead you should use a [connector class](https://meta.discourse.org/t/important-changes-to-plugin-outlets-for-ember-2-10/54136) for your outlet. Additionally, you could just create a new ember component and use it in your connector – it should have `this.currentUser` to know about the current person who is logged in.

Taking it a step further, just in your template you should be able to say `{{currentUser.username}}` and find out things about your user in there too.

---

<div class="post-metadata">

### Author: ![mandarbapaye](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@mandarbapaye](https://meta.discourse.org/u/mandarbapaye)
#### Post date: [March 23, 2017, 6:15pm UTC](https://meta.discourse.org/t/dynamic-templates-for-plugin-outlet-uis/59786/3 "2017-03-23T18:15:00Z")

</div>

Hi Robin - Thanks so much for the quick reply. I will checkout the connector class.

Regards  
Mandar

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [March 23, 2017, 6:26pm UTC](https://meta.discourse.org/t/dynamic-templates-for-plugin-outlet-uis/59786/4 "2017-03-23T18:26:47Z")

</div>


