How to use a Password Unit?


Well-known member
When you create an option in XF, it gives you a dropdown of edit formats. There is a "Text Box" option, but not one for passwords. Looking in the compiler classes though, a password unit helper does in fact exist.

How do I make a password box option?

Chris D

XenForo developer
Staff member
Set the format to Named Template, create an admin template and reference that in the Format Parameters.

The admin template could look something like this:

            <xen:passwordunit label="{$preparedOption.title}" name="{$fieldPrefix}[{$preparedOption.option_id}]">
                <xen:explain>{xen:raw $preparedOption.explain}</xen:explain>
                    <input type="hidden" name="{$listedFieldName}" value="{$preparedOption.option_id}" />
                    {xen:raw $editLink}