# Conditionally rendering a plugin outlet

**URL:** <https://meta.discourse.org/t/conditionally-rendering-a-plugin-outlet/53838>\
**Category:** Development\
**Created:** [6. Dezember 2016 um 06:14 UTC](https://meta.discourse.org/t/conditionally-rendering-a-plugin-outlet/53838 "2016-12-06T06:14:50Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [6. Dezember 2016 um 19:23 UTC](https://meta.discourse.org/t/conditionally-rendering-a-plugin-outlet/53838/4 "2016-12-06T19:23:17Z")

</div>

I spent a couple of hours on this and it’s unfortunately not easy either.

The plugin outlet is implemented as keyword that basically does the same thing as the `partial` tag in ember that hoists a block into the upper template, except I hoist a template we’ve declared as a connector.

Now of course I can conditionally do that, however it seems that I can’t access the scope of the keyword (or I can’t figure out how to anyway) because everything in ember is based on streams of dependencies that are passed into things.

There doesn’t seem to be any easy way in a keyword handler to call `this.get('model.solved_count')` ☹

If you’re feeling adventurous and think you can figure out something in Ember’s API to do this, here’s my work:

[https://github.com/discourse/discourse/commit/7b8e4a7110df1c40fa952df5fe216d844fbecc9d](https://github.com/discourse/discourse/commit/7b8e4a7110df1c40fa952df5fe216d844fbecc9d)

---

_[View the full topic](https://meta.discourse.org/t/conditionally-rendering-a-plugin-outlet/53838)._
