# Check for group membership in Header code?

**URL:** <https://meta.discourse.org/t/check-for-group-membership-in-header-code/72642>\
**Category:** UX\
**Created:** [10월 23, 2017, 9:03오후 UTC](https://meta.discourse.org/t/check-for-group-membership-in-header-code/72642 "2017-10-23T21:03:24Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)\
**Post date:** [10월 23, 2017, 11:43오후 UTC](https://meta.discourse.org/t/check-for-group-membership-in-header-code/72642/4 "2017-10-23T23:43:05Z")

</div>

It sort of depends on where that is being added. Is that a custom header? Or are you trying to add them on the same line as the logo?

If on the same line as the logo, this is close (create it as a custom component and enable it as part of your theme, in the `</head>` section)

```plaintext
<script type="text/discourse-plugin" version="0.2">
api.decorateWidget('home-logo:after', helper => {
        const user = Discourse.User.current();
        if(user.primary_group_name.toLowerCase() === "group1") {
            return helper.h('div#top-navbar.container', [
                    helper.h('span#top-navbar-links', [
                        helper.h('a.btn.btn-lg.btn-primary', {
                            href:'https://www.demo.com/', 
                            text:'<i class="fa fa-flag fa-2x pull-left"></i> Click here<br>for demo!' // not sure if this will work
                        })
                    ])
            ]);
        }
});
</script>

```

---

_[View the full topic](https://meta.discourse.org/t/check-for-group-membership-in-header-code/72642)._
