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

xen:explain -- Restrictions on use?

Discussion in 'XenForo Development Discussions' started by Kevin, Nov 14, 2011.

  1. Kevin

    Kevin Well-Known Member

    I am trying to create the below admin' template....
    <xen:uploadunit label="{xen:phrase myapp_files1}" name="target" value="">
        <div id="targetHtml">{xen:if "{$targetFound}", {xen:phrase my_msg1, "target={$targetPath}"}}</div>
    <xen:uploadunit label="{xen:phrase myapp_files2}" name="file" value="">
        <div id="fileHtml">{$additionalFiles}</div>
    <xen:explain>{xen:phrase myapp_phrase}</xen:explain>
    ... which is then used inside of another form but when I try to save it with the xen:explain tags I get an error message that explain is invalid. :oops:

    Is there a restriction on where/when I can use xen:explain?
  2. Fuhrmann

    Fuhrmann Well-Known Member

    I think the explain tag is only used inside another "xen" tag. Something like this:

    <xen:textboxunit label="{xen:phrase email_to_ban}:" name="email">
                <xen:explain>{xen:phrase you_may_use_star_to_represent_wildcards_automatically_added}</xen:explain>
    <xen:checkboxunit label="{xen:phrase archive_import_log}" value="0">
            <xen:option name="archive">
                <xen:label>{xen:phrase archive_the_import_log}:</xen:label>
                <xen:textbox name="table" value="archived_import_log" />
            <xen:explain>{xen:phrase archive_import_log_explain}</xen:explain>
    <xen:selectunit label="{$preparedOption.title}" name="{$fieldPrefix}[{$preparedOption.option_id}]" value="{$preparedOption.option_value}"
    hint="{$preparedOption.hint}" inputclass="{$preparedOption.inputClass}">
        <xen:options source="$formatParams" />
        <xen:explain>{xen:raw $preparedOption.explain}</xen:explain>
            <input type="hidden" name="{$listedFieldName}" value="{$preparedOption.option_id}" />
            {xen:raw $editLink}
    <xen:textboxunit label="{xen:phrase group_name}:" name="group_name" value="{$group.group_name}">
            <xen:explain>{xen:phrase this_is_unique_identifier_for_this_group}</xen:explain>
  3. Fuhrmann

    Fuhrmann Well-Known Member

    You can take a look at the function _wrapControlUnit($label, $controlText, $id, array $rowOptions) and see that the <xen:explain is only handle in there.
    (file library/XenForo/Helper/Admin.php)
    Kevin likes this.
  4. Kevin

    Kevin Well-Known Member

    HHhhmm... with 1.1 B5 I'm not seeing "library/XenForo/Helper/Admin.php" but I get your drift, thanks.

    Any suggestions on achieving the goal?
  5. Kevin

    Kevin Well-Known Member

    ... it is library/XenForo/Template/Helper/Admin.php :)

    Looking at the code, I can do it with just a paragraph tag using the "explain" class.
    Thanks for pointing me in the direction. (y)
    Fuhrmann likes this.
  6. Fuhrmann

    Fuhrmann Well-Known Member

    Yes, you could do that too...good point!

    Sorry about the mistake! :)

Share This Page