# Hoe registreer ik een ember helper voor een thema component?

**URL:** <https://meta.discourse.org/t/how-to-register-an-ember-helper-for-a-theme-component/167829>\
**Category:** Product Support\
**Created:** [21 oktober 2020 om 07:44 UTC](https://meta.discourse.org/t/how-to-register-an-ember-helper-for-a-theme-component/167829 "2020-10-21T07:44:35Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![oca](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/oca/32/156060_2.png) [@oca](https://meta.discourse.org/u/oca)\
**Post date:** [21 oktober 2020 om 07:44 UTC](https://meta.discourse.org/t/how-to-register-an-ember-helper-for-a-theme-component/167829/1 "2020-10-21T07:44:35Z")

</div>

I’m writing some theme component that would do something arbitrary to a specific category. The only variable I have access in the component is the list of categories, and I’d like to extract the correct one.

```python
c for c in category_list if c.slug == 'foobar'

```

With ember limited logic, I would need to do something like that:

```hbs
{{#if category.slug == 'foobar'}}

```

which is not possible with vanilla version. We need to add a helper for something as low level as a comparison.

There are two main options:

1. Add a method/property in the object that would return `True` only for the correct category in the list.
2. Register an `eq` helper, and is appears to me that [this one](https://github.com/jmurphyau/ember-truth-helpers) is quite the standard.  
`{{#if (eq person "John")}} hello {{/if}}`

So far, I don’t know how to do any of that for a theme component.  
I’ve seen [a post](https://meta.discourse.org/t/how-to-add-an-ember-js-helper/40214) explaining how to do 2. it in a plugin but it seems irrelevant for a theme.

Can someone explain to me how to proceed?

And can the core team consider adding quite-standard logic helpers in discourse-commons? I’m sure the would be useful for a lot of low skill theme dev like me.

---

_[View the full topic](https://meta.discourse.org/t/how-to-register-an-ember-helper-for-a-theme-component/167829)._
