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

Get current id style

Discussion in 'XenForo Development Discussions' started by Zephyr, Aug 5, 2013.

  1. Zephyr

    Zephyr Well-Known Member

    Hello, how get current id style inside a template please ?

    Exemple :
    Code:
    <xen:if is="{$currentStyleId} == {$xencreaIdStyles}">
        <!-- my code.... -->
    {$xencreaIdStyles} is a string of styles id => "1,6,8,9"

    Thanks for help :)
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Code:
    <xen:if is="in_array({$currentStyleId}, array({$xencreaIdStyles}))">    
        <!-- my code.... -->
    </xen:if>
    Should work.
     
  3. Zephyr

    Zephyr Well-Known Member

    Thanks, but $currentStyleId (for example) is a non existing variable, you know how to retrieve the id of the current style please?
     
  4. Arty

    Arty Well-Known Member

    {$visitorStyle.style_id}
     
    Zephyr and Chris D like this.
  5. Zephyr

    Zephyr Well-Known Member

    Thanks Arty, but not work :

    Code:
    <xen:if is="{$visitorStyle.style_id} == 3">
        <xen:include template="xencrea_header.css" />
    </xen:if>
    My id :
    demo.xencrea.com/misc/style?style_id=3&_xfToken=1%2C1375735124%2Cecb0128c8d7dd6c932e78420b7346c2024851fa3&redirect=%2F

    <xen:include template="xencrea_header.css" /> is not loaded.
     
  6. Jeremy

    Jeremy XenForo Moderator Staff Member

    Try just $visitor.
     
  7. Zephyr

    Zephyr Well-Known Member

    Same :s
    TMS use a cache system ?
     
  8. Zephyr

    Zephyr Well-Known Member

    It's good, a bad condition inside a old template.
    Thanks for help :)
     
  9. Arty

    Arty Well-Known Member

    If all those styles have same parent style you can compare it to $visitorStyle.parent_id instead.
     

Share This Page