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

XF 1.5 Conditional in xen:select

Snog

Well-known member
#1
Are conditionals processed in a template's xen:select section?

I've tried various iterations of this and none of them seem to work...
Code:
<xen:select name="default_sort_order" value="{$forum.default_sort_order}" inputclass="autoSize">
   <xen:option value="last_post_date">{xen:phrase last_message}</xen:option>
   <xen:option value="post_date">{xen:phrase start_date}</xen:option>
   <xen:option value="title">{xen:phrase title}</xen:option>
   <xen:option value="reply_count">{xen:phrase replies}</xen:option>
   <xen:option value="view_count">{xen:phrase views}</xen:option>
   <xen:if is="{$forum.node_id} == 3"><xen:option value="addon_value">{xen:phrase addon_phrase}</xen:option></xen:if>
</xen:select>
 
Last edited:

Chris D

XenForo developer
Staff member
#2
I don't think so as far as I can recall. This would therefore require duplicating the entire select inside the conditional or if you can prepare the options in PHP and send it to the template then you can pass that array through to an <xen:options source="" /> tag.

FWIW you can do this in XF2 and it supports for each tags inside too.