• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 How to use "tag" as "class" just like how "node id" currently behave?

#1
Hello,

I want to make certain tag page have different background. This is very easy to achieve on nodes because <body> tag have "node id" as their class.

But how to use "tag" as "class"?

i modded the original code to become like this

Code:
<body{xen:if {$bodyClasses}, ' class="{$bodyClasses}"'}{xen:if {$tag.tag}, ' class="{$tag.tag}"'}>
but it does not show the tag :(
forum/tags/blablabla

still have classless <body>


thank you

EDIT:

okay i used

Code:
 class="<xen:if
                                       
                                        is="{$title}">{xen:raw $title}</xen:if>">
and it allows the tag to be inserted as class. But.... it also insert titles from any other forums.

is there a way to make "if statement" that works like this?

Code:
if in tags page
then do {xen:raw $title}
 
Last edited:
#2
ok found the solution.

change
Code:
<body{xen:if {$bodyClasses}, ' class="{$bodyClasses}"'}>

to

Code:
<body{xen:if {$bodyClasses}, ' class="{$bodyClasses}"', ' class="{$title}"'}>