1. 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?

Discussion in 'XenForo Development Discussions' started by Jaxel, Aug 17, 2013.

  1. Jaxel

    Jaxel 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?
     
  2. Chris D

    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:

    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>
    
     
  3. Jaxel

    Jaxel Well-Known Member

    Thanks. Amazed there isn't a built in template for the password unit.
     

Share This Page