# Display different content within a topic based on user's groups membership?

**URL:** <https://meta.discourse.org/t/display-different-content-within-a-topic-based-on-users-groups-membership/227075>\
**Category:** Development\
**Created:** [May 15, 2022, 12:01pm UTC](https://meta.discourse.org/t/display-different-content-within-a-topic-based-on-users-groups-membership/227075 "2022-05-15T12:01:25Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![craigconstantine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/craigconstantine/32/511195_2.png) [@craigconstantine](https://meta.discourse.org/u/craigconstantine)\
**Post date:** [May 15, 2022, 12:01pm UTC](https://meta.discourse.org/t/display-different-content-within-a-topic-based-on-users-groups-membership/227075/1 "2022-05-15T12:01:26Z")

</div>

I’m working in [discourse.org](http://discourse.org)’s hosting, so plugins are not possible for me in this case. Imagine I have a topic posted where anyone can see it.

If someone is in group “A” then I want them to see _this_ content. If NOT, then I want them to see _this other_ content. And some of the topic everyone should see. Schematically like this…

```plaintext
This is content everyone sees.

{wishful thinking: only for ppl in group A}
Hey thanks for being in the special group!
{/wishful}

{wishful thinking: only for ppl NOT in group A}
Hey we have a special group you can join. [Read more about that](…)
{/wishful}

```

I feel confident (but forget exactly how to do it) that this can be done with a theme component to set CSS classes on the content I want to “toggle” display of. I’ll do this if this is the best I can figure out.

But CSS `display: none` is weak sauce. I’d like to disappear from the DOM what they shouldn’t see. Disappeared server-side if possible, but I’d settle for at least j/s based disappeared browser-side. (That requires a much higher clever-level to get around than `display: none` does in CSS.)

---

_[View the full topic](https://meta.discourse.org/t/display-different-content-within-a-topic-based-on-users-groups-membership/227075)._
