# Group specific Banner Topics?

**URL:** https://meta.discourse.org/t/group-specific-banner-topics/56074
**Category:** Support
**Created:** [January 20, 2017, 12:44pm UTC](https://meta.discourse.org/t/group-specific-banner-topics/56074 "2017-01-20T12:44:38Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [January 20, 2017, 12:44pm UTC](https://meta.discourse.org/t/group-specific-banner-topics/56074/1 "2017-01-20T12:44:38Z")

</div>

I have a situation where I want to display different Banner Topics dependent on the users group membership. Namely, I’d like to show one banner if a user isn’t logged in and a different one if they are but aren’t a part of a specific group.

I could likely set up categories to target the two sectors but is it possible to target users with specific Banner Topics? I’d rather not build a customization to do it but I’m also not tossing that idea.

I saw how to [hide a banner from anonymous users](https://meta.discourse.org/t/display-banner-topic-only-to-logged-in-users/55282), but not how to show two different banners.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 20, 2017, 2:49pm UTC](https://meta.discourse.org/t/group-specific-banner-topics/56074/2 "2017-01-20T14:49:57Z")

</div>

I worry that this would be extremely confusing from an admin perspective. I would need a completely new UI to support configuring this without enormous amounts of admin confusion.

One hacky possibility with minimal change would be to have one big banner for everyone and then use CSS to hide bits.

---

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [January 20, 2017, 2:58pm UTC](https://meta.discourse.org/t/group-specific-banner-topics/56074/3 "2017-01-20T14:58:05Z")

</div>

That was my concern as well. It would be a pain to manage as an admin. I just wondered if it was even possible.

> [@sam](#):
>
> On hacky possibility with minimal change would be to have one big banner for everyone and then use CSS to hide bits.

I may give this a try as it seems much quicker and easier than building the full customization via plugin. But last I knew, we couldn’t apply CSS classes or ids via the composer. Outside of using an nth-selector, is there another way to do this?

---

<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: [January 20, 2017, 3:00pm UTC](https://meta.discourse.org/t/group-specific-banner-topics/56074/4 "2017-01-20T15:00:19Z")

</div>

I know you can do it for anon versus logged in, but I’m not sure you can achieve it via Groups. As to my knowledge there is no high-level (on the `html` or `body` tag) CSS class denoting the group the user is a part of.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 20, 2017, 3:00pm UTC](https://meta.discourse.org/t/group-specific-banner-topics/56074/5 "2017-01-20T15:00:24Z")

</div>

> [@joebuhlig](#):
>
> Outside of using an nth-selector, is there another way to do this?

Yeah it is not going to be easy, nth selector is what you are going to be forced to use. Otherwise you are going to be forced to whitelist stuff for everyone.

---

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [January 20, 2017, 3:07pm UTC](https://meta.discourse.org/t/group-specific-banner-topics/56074/6 "2017-01-20T15:07:33Z")

</div>

Thanks, @sam and @cpradio. I think my plan of attack will be to add the group names to the body/html classes and follow down to the nth `div` of the banner topic. 👍

---

<div class="post-metadata">

### Author: ![bekircem](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bekircem/32/44582_2.png) [@bekircem](https://meta.discourse.org/u/bekircem)
#### Post date: [September 21, 2018, 2:23pm UTC](https://meta.discourse.org/t/group-specific-banner-topics/56074/7 "2018-09-21T14:23:20Z")

</div>

Are you going to use :nth-child () selector?

> **[:nth-child() CSS pseudo-class - CSS | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:nth-child)**
>
> The :nth-child() CSS pseudo-class matches elements based on the indexes of the elements in the child list of their parents. In other words, the :nth-child() selector selects child elements according to their position among all the sibling elements...

But how to add group names to the body/html classes? Can you give me an example?

---

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [September 23, 2018, 12:39am UTC](https://meta.discourse.org/t/group-specific-banner-topics/56074/8 "2018-09-23T00:39:14Z")

</div>

Ended up going a different route entirely. I built a custom theme that inserts the pieces I need as a header. The theme did all the work I needed.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 28, 2021, 2:45pm UTC](https://meta.discourse.org/t/group-specific-banner-topics/56074/9 "2021-05-28T14:45:38Z")

</div>



---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [January 24, 2024, 12:45pm UTC](https://meta.discourse.org/t/group-specific-banner-topics/56074/10 "2024-01-24T12:45:24Z")

</div>

Digging out this one

We currently have a client category for all our clients including subcategories for each individual ones.  
Now we are looking for a way to display a banner topic which is only visible to users who are in the client group.

Has anyone been able to find a workaround for this?

Hiding via CSS is unfortunately not an option, as we don’t want to contents to be accessible via Inspect tool

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [January 27, 2024, 1:56am UTC](https://meta.discourse.org/t/group-specific-banner-topics/56074/11 "2024-01-27T01:56:31Z")

</div>

Not sure if this plugin might work but the plugin Author is excellent and may consider feature request.

> [@Discourse Category Home house](https://meta.discourse.org/t/discourse-category-home/214227):
>
> Summary: Give users each a specific Homepage (“Home Category”) in your community. It allows you to have a single Discourse in which users have specific “home pages” (read: Category) as determined by their Primary Group. link GitHub: [Repository](https://github.com/merefield/discourse-category-home) https://github.com/merefield/discourse-category-home arrow_right Install: Follow the [plugin installation guide](https://meta.discourse.org/t/install-a-plugin/19157). Enjoying this plugin? Please star it on [GitHub](https://github.com/merefield/discourse-category-home)! prayFeatures Using only the available interface elements of a normal Discourse…
