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

Get current id style

Zephyr

Well-known member
#1
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 :)
 

Chris D

XenForo developer
Staff member
#2
Code:
<xen:if is="in_array({$currentStyleId}, array({$xencreaIdStyles}))">    
    <!-- my code.... -->
</xen:if>
Should work.
 

Zephyr

Well-known member
#3
Thanks, but $currentStyleId (for example) is a non existing variable, you know how to retrieve the id of the current style please?
 

Zephyr

Well-known member
#5
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.
 

Arty

Well-known member
#9
If all those styles have same parent style you can compare it to $visitorStyle.parent_id instead.