Not a bug Cannot use curly style template function in <xen> tags

tyteen4a03

Well-known member
Title.

Example code:

Code:
<xen:checkboxunit label="{$preparedOption.title}" name="{$fieldPrefix}[{$preparedOption.option_id}]" hint="{$preparedOption.hint}">
   <xen:option name="{$fieldPrefix}[{$preparedOption.option_id}][display][posts]" label="{xen:phrase 3ps_usergroup_ranks_in_posts}" {xen:checked $preparedOption.option_value.display.posts}>
     <xen:select name="{$fieldPrefix}[{$preparedOption.option_id}][display_position][posts]" value="{$preparedOption.option_value.display_position.posts}">
       <xen:option value="0">{xen:phrase 3ps_usergroup_ranks_over_avatar}</xen:option>
       <xen:option value="1">{xen:phrase 3ps_usergroup_ranks_under_avatar}</xen:option>
       <xen:option value="2">{xen:phrase 3ps_usergroup_ranks_above_username}</xen:option>
       <xen:option value="3">{xen:phrase 3ps_usergroup_ranks_under_user_title}</xen:option>
     </xen:select>
   </xen:option>
   <xen:explain>{xen:raw $preparedOption.explain}</xen:explain>
   <xen:html>
     <input type="hidden" name="{$listedFieldName}" value="{$preparedOption.option_id}" />
     {xen:raw $editLink}
   </xen:html>
</xen:checkboxunit>

Notice that the compiler will throw a fit on line 2 about xen:checked being there. Replace xen:checked with xen : if, xen:escape or any other functions, it will also throw a fit.

I also noticed that all admin templates that require the use of functions uses the input tag instead of xen : option, so this might be a suggestion instead.
 
Last edited:
it's just
selected="{$preparedOption.option_value.display.posts}


Take a look at the template "option_template_captcha" which is probably similar to what you need
 
Last edited:
Of course you can't - that's not how the template syntax works... You have to write valid HTML-esque syntax.
 
Top Bottom