If condition for style?

AzzidReign

Well-known member
Is there an if condition that allows for showing certain content on certain styles? Reason I ask is bc of an addon, I'd like to wrap it in a conditional so it shows 1 thing on my main style and another thing on my mobile style.
 
In templates, the variable to check is
Code:
{$visitorStyle.style_id}

In php (through a template listener) you can get this variable doing:
PHP:
$style_session = $template->getParam('visitorStyle');
$styleId = $style_session['style_id'];

Edit: so the conditional in template would be:
Code:
{xen:if "{$visitorStyle.style_id} == X", "Do this", "Else do that"}
X being a number (your styleid)
or
Code:
<xen:if is="{$visitorStyle.style_id} == X">
Do this
<xen:else />
Do that
<xen:if />
 
In templates, the variable to check is
Code:
{$visitorStyle.style_id}

In php (through a template listener) you can get this variable doing:
PHP:
$style_session = $template->getParam('visitorStyle');
$styleId = $style_session['style_id'];

Edit: so the conditional in template would be:
Code:
{xen:if "{$visitorStyle.style_id} == X", "Do this", "Else do that"}
X being a number (your styleid)
or
Code:
<xen:if is="{$visitorStyle.style_id} == X">
Do this
<xen:else />
Do that
<xen:if />
Thank you much. For some reason if conditionals don't work well with digitalpoint's ad positioning. :(
 
Back
Top Bottom