I’m trying to figure out the best way to register a handlebars helper for my Discourse plugin.
I have an ajax call in my initializer that determines whether the currentUser is part of a particular group. If they are, then they get an extra nav item.
I wanted to do something like this in my hbs file for the nav:
{{#if customHelper}}
//show nav item
{{/if}}
My other theories on how to do this:
Keep the logic in the initializer and use jquery to append the item to the nav.
Create a component for the nav item to only be displayed given the aforementioned logic.
So do you think registering a helper is the best to go, if so how? Or are one of my other approached better.