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

New div class only on a thread hmm

Discussion in 'XenForo Questions and Support' started by Wuebit, Mar 14, 2011.

  1. Wuebit

    Wuebit Well-Known Member

    Is there a way I can get this class
    PHP:
    <div class="anime30">
    To only work on the thread page as in the page you are viewing right now
    But here is the problem I need to add it in the PAGE_CONTAINER right under
    PHP:
    <div class="pageContent">
    Thanks
    Edit is there an IF condition or something like that for xenforo?
     
  2. Kier

    Kier XenForo Developer Staff Member

    PHP:
    {$controllerName} == 'XenForo_ControllerPublic_Thread' AND {$controllerAction} == 'Index'
     
    Vodkaholic and Darkimmortal like this.
  3. Wuebit

    Wuebit Well-Known Member


    Thanks Kier I was reading your other post about IF conditions just now :)
    But am still unsure on how to use that code. Could you explain alittle more for me please.
    Thanks

    Edit do you mean like this
    PHP:
    <xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Thread' AND {$controllerAction} == 'Index'"><div class="anime30"><xen:if>
     
  4. Kier

    Kier XenForo Developer Staff Member

    If you want to attach the class to an existing <div />, do this:
    HTML:
    <div class="{xen:if '{$controllerName} == "XenForo_ControllerPublic_Thread" AND {$controllerAction} == "Index"', 'anime30'}">
    If you want to insert the whole <div /> conditionally, do this:
    HTML:
    <xen:if is="{$controllerName} == 'XenForo_ControllerPublic_Thread' AND {$controllerAction} == 'Index'"><div class="anime30"></xen:if>
     
    Vodkaholic likes this.
  5. Wuebit

    Wuebit Well-Known Member

    Thank you for showing me works great :love:
     

Share This Page