# Hide certain group settings if group name includes a specific name

**URL:** <https://meta.discourse.org/t/hide-certain-group-settings-if-group-name-includes-a-specific-name/237917>\
**Category:** Development\
**Created:** [September 2, 2022, 8:25am UTC](https://meta.discourse.org/t/hide-certain-group-settings-if-group-name-includes-a-specific-name/237917 "2022-09-02T08:25:48Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![AquaL1te](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aqual1te/32/201966_2.png) [@AquaL1te](https://meta.discourse.org/u/AquaL1te)\
**Post date:** [September 2, 2022, 8:25am UTC](https://meta.discourse.org/t/hide-certain-group-settings-if-group-name-includes-a-specific-name/237917/1 "2022-09-02T08:25:48Z")

</div>

I’ve created a custom plugin to include some extra fields for groups. But they only apply to groups with the name “chapter” in it. So it doesn’t make sense to have them in groups for other purposes. Is there some way I can create a condition that checks e.g. `if chapter in group.name; then chapter = true`?

I have the following:

> <https://github.com/kees-closed/discourse-group-custom-fields/blob/master/assets/javascripts/discourse/connectors/group-edit/field-container.hbs>

I want to hide the control group at the top if the group name does not have the word chapter in it. I seem to already use some Jinja2 stuff from the example I used. If that’s anything like other Jinja2, then I can certainly create such a condition there. But then I need to know a few things.

- If Jinja2 is fully available, how can I access the group name variable to create the condition?
- If Jinja2 is not (fully) available, how can I create this condition then? Probably some other JavaScript should set a boolean I suppose. But the structure of these group variables and JavaScript logic is not known to me, any examples would great!

---

_[View the full topic](https://meta.discourse.org/t/hide-certain-group-settings-if-group-name-includes-a-specific-name/237917)._
