هل لا يزال إضافة المجموعات إلى مكون سمة CSS يعمل؟

Does this Theme Component still work?

It didn’t seem to do anything for me despite lots of groups being set to be visible to ‘logged in users’. It could be very handy for several things!

As far as I know, Discourse adds the user groups to the body tag without any theme component :thinking:

Captura

إعجابَين (2)

I just tried it, and it seems to work fine. Do you see any errors in the console?

To be clear, that component only adds the current user’s groups as CSS classes on the <body> tag.

We use that component here on Meta. Discourse only adds a single class for the current user’s primary group by default.

3 إعجابات

Interesting fact, I had seen it in other communities and assumed it was something by default :sweat_smile:

إعجاب واحد (1)

Hmmm - maybe it doesn’t work in login-only sites. Or if group visibility is set below everyone.

إعجاب واحد (1)

Just tested that, and it worked OK for me. As soon as the user is logged-in, the group classes get added to the <body> tag.

I also tested that, and it seems to work without issue. I tried all five visibility options.

Can you share a link to the site you’re seeing this issue on?

إعجاب واحد (1)

Actually, the problem was user stupidity!

I was adding it to the default Theme. Unfortunately I forgot that I was using a dev Theme for my own account. Doh!

Thanks for looking into it, and sorry to waste your time! It is a good TC - could do with some documentation, eh?

إعجابَين (2)

No worries, glad you got it sorted.

:+1:

إعجابَين (2)

This topic was automatically closed after 4 hours. New replies are no longer allowed.