XF 2.1 xf:hint in xf:formrow?

Jaxel

Well-known member
With a normal input field I can do something like this:
Code:
<xf:textboxrow label="{$field.field_name}" class="{$field.field_key}" name="fields[{$field.field_key}]">
    <xf:hint>
        <xf:if is="$field.canEdit()">
            {$field.field_key} ({$field.field_order})
            <a href="{{ link('field/edit', $field) }}">{{ phrase('edit') }}</a>
        </xf:if>
    </xf:hint>
</xf:textboxrow>

However, doing the same thing in a xf:formrow field, results in an unknown tag 'xf:hint' error.

How can I accomplish what I am trying to do in an xf:formrow?
 
<xf:formrow rowtype="RowType" label="Label" hint="Hint">
Or
<xf:formrow rowclass="RowClass" label="Label" hint="Hint">
 
Last edited:
Put your hint in a phrase that has replacement variables and use that.

<xf:formrow rowtype="RowType" label="Label" hint="{{ $field.canEdit() ? phrase('YourPhrase', {YourVariables}) : '' }}">
 
This should work pretty well:
HTML:
<xf:set var="$hintHtml"><xf:if is="$field.canEdit()">
    {$field.field_key} ({$field.field_order})
    <a href="{{ link('field/edit', $field) }}">{{ phrase('edit') }}</a>
</xf:if></xf:set>
<xf:formrow hint="{$hintHtml}"> ... </xf:formrow>
 
Back
Top Bottom