Discourse groups css classes in body

Thanks to @Johani I found this great theme component made by @Falco :pray: Now all groups of a user are set in the body tag. I was searching for a solution but didn’t find any mention of this component.

https://github.com/discourse/discourse-groups-css-classes-in-body

I found a strange thing about the component (except admin user). When I add a user to a group, the body tag is not changing - a newly added group is not showed in the body tag.

I refreshed the page, logout, checked in incognito, switched between browsers, checked on different servers… nothing helps.

@Falco, can you please check the problem?

Update: the problem is caused because of the Visibility status of the chosen groups. I had set: Visible to group owners and Admin. That’s why the component couldn’t show the group name in the body tag. If I set to Visibility: Everyone - it started working correctly.

I think this is not a correct work of the component. Am I right?

That is the expected behavior of the component. If a group is not visible to the current user it won’t be added to the body class list, as that would be an information leak.

1 Like

Thank you! I understood. By the way, you component solve a very important task. It should be at least in the components list.

1 Like

The Theme Component mentioned above has now been published:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.