1. 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?

Discussion in 'Styling and Customization Questions' started by radenmas, Oct 1, 2015.

  1. radenmas

    radenmas New Member

    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: Oct 1, 2015
  2. radenmas

    radenmas New Member

    ok found the solution.

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

    to

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

Share This Page