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

How to use a Password Unit?

Jaxel

Well-known member
#1
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
#2
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:

Code:
            <xen:passwordunit label="{$preparedOption.title}" name="{$fieldPrefix}[{$preparedOption.option_id}]">
                <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:passwordunit>