Daniel 'RTRD'
Well-known member
Is it possible to use <xen:if is="{$xenOptions.SomeRandomOption} == 0"> in CSS?
But the template is CSS and that code is "HTML". Would it still work?Yes, if that variable is available in your CSS template.
Is there any way to do this in CSS?No, you cannot use XenForo template syntax in any template ending in .css.
<xen:if is="!{$xenOptions.someOption}">
<xen:require css="someOption.css" />
<xen:else />
<xen:require css="someOther.css" />
</xen:if>
<div class="primaryContent {xen:if '!{$xenOptions.someOption}', 'someClass', 'someOtherClass'}">
Stuff
</div>
Option:What do you mean?
<option option_id="RandomOption" edit_format="radio" data_type="string" can_backup="1">
<default_value>2</default_value>
<edit_format_params>1 = Yes
2 = No</edit_format_params>
<sub_options></sub_options>
<relation group_id="RandomOption" display_order="20"/>
</option>
<xen:if is="{$xenOptions.RandomOption} == 1">
do something
</xen:if>
error={xen:phrase reg_form_error}
redirect={xen:phrase reg_form_redirect}
success={xen:phrase reg_form_success}
Code:<xen:if is="{$xenOptions.RandomOption} == 1"> do something </xen:if>
This does not seem to work for me. Why?
[CODE]<xen:if is="{$xenOptions.RandomOption} == '1'">
do something
</xen:if>[/CODE]
Still the same.Should work...
Only thing I'd say, is, whenever I do format parameters, I don't use spaces...
So the format parameters on one option on my Registration Form Timer add-on look like:
Code:error={xen:phrase reg_form_error} redirect={xen:phrase reg_form_redirect} success={xen:phrase reg_form_success}
Maybe the space between the option ID and the text is breaking it somehow?
Try placing the half-quotes around the 1.
PHP:[CODE]<xen:if is="{$xenOptions.RandomOption} == '1'"> do something </xen:if>[/CODE]
<xen:if is="{$pageIsRtl}">
/* Flip these around as they point left and right */
.xenForoSkin span.mce_indent {background-position:-540px 0}
.xenForoSkin span.mce_outdent {background-position:-400px 0}
<xen:else />
.xenForoSkin span.mce_indent {background-position:-400px 0}
.xenForoSkin span.mce_outdent {background-position:-540px 0}
</xen:if>
a:link,
a:visited
{
{xen:helper cssImportant, @property "link";
color: @primaryMedium;
text-decoration: none;
@property "/link";}
{xen:helper cssImportant, @property "ugcLink";
padding: 0 3px;
margin: 0 -3px;
border-radius: 5px;
@property "/ugcLink";}
}
{xen:helper clearfix, '.AttachmentEditor .AttachedFile .controls'}
<xen:require css="css_template.css" />
No, you cannot use XenForo template syntax in any template ending in .css.
Can you provide an example? To my knowledge you can't use any syntax except the ones specifically for CSS templates.We successfully use XenForo template syntax in .css templates.
Can you provide an example? To my knowledge you can't use any syntax except the ones specifically for CSS templates.
We use essential cookies to make this site work, and optional cookies to enhance your experience.