XF 2.1 Display Condition For A Style?

@Masetrix

im still very much learning when it comes to code.

im sure i have to slightly edit the code you suggested in post #2 to fit with the style names i have on my forum. these are the styles i have available in my forum...

1572344285466.webp

if i wanted a particular widget to show ONLY in the 'Shades of Grey (Blue text) style/theme i presume i need to add a display condition to that widget telling it to only display in that theme. thats the code i am looking for, please :)
 
Assuming you are working with widgets, just enter the following code in the field "Display condition":

Code:
{$xf.visitor.style_id} == 1

You have to replace "1" with the style ID of your "Shades of Grey (Blue text)" style.
thank you.

so as you can see, SoG (cream) is not active. would this make SoG (blue) style id 3 or 4.
embarrassed asking such noob stuff :oops:
 
It doesn't matter if your style is active or not :) The ID is assigned to your style once it is created. You can get the ID from the URL by simply hovering over your desired style. On my admincp, it would look like this when I'm hovering style "Finexes e. V. - Abyss":

style.webp

In this case, the style ID is 7. Is it now a little bit more understandable for you?
 
Back
Top Bottom