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

How to nest options with <xen:controlunit>?

tyteen4a03

Well-known member
#1
Basically I want to achieve this:

options.png
(notice that the checkbox next to the option are gone)
I tried using <xen:controlunit> and multiple <xen:things> but they wouldn't stack properly, using <dt> and <ul> for nesting but it looks weird, I'll upload a pic if anybody needs it). Is there a way I can build nested options with <xen:controlunit>?
 

tyteen4a03

Well-known member
#2
I ended up solving this problem by reinventing the wheel... *sigh*

boldText class is just font-weight: bold.

Code:
<xen:require css="3ps_usergroup_ranks_admin.css" />
 
<dl class="ctrlUnit">
    <input type="hidden" name="{$listedFieldName}" value="{$preparedOption.option_id}" />
    {xen:raw $editLink}
    <dt>{$preparedOption.title}</dt>
    <dd>
        <ul>
            <li>
                <label class="boldText">{xen:phrase 3ps_usergroup_ranks_in_posts}:</label>
                <ul>
                    <li>
                        <label for="{$fieldPrefix}[{$preparedOption.option_id}][style][posts]">{xen:phrase 3ps_usergroup_ranks_calculation_style}</label>
                        <xen:radio name="{$fieldPrefix}[{$preparedOption.option_id}][style][posts]" selected="{$preparedOption.option_value.style.posts}">
                            <xen:option value="0">{xen:phrase 3ps_usergroup_ranks_fixed}</xen:option>
                            <xen:option value="1">{xen:phrase 3ps_usergroup_ranks_dynamic}</xen:option>
                        </xen:radio>
                    </li>
                    <li>
                        <label for="{$fieldPrefix}[{$preparedOption.option_id}][value][posts]">{xen:phrase 3ps_usergroup_ranks_value}</label>
                        <ul>
                            <li>
                                <xen:spinbox name="{$fieldPrefix}[{$preparedOption.option_id}][value][posts]" value="{$preparedOption.option_value.value.posts}" min="0" />
                            </li>
                        </ul>
                    </li>
                </ul>
            </li>
        </ul>
        <ul>
            <li>
                <label class="boldText">{xen:phrase 3ps_usergroup_ranks_in_member_list}:</label>
                <ul>
                    <li>
                        <label for="{$fieldPrefix}[{$preparedOption.option_id}][style][member_list]">{xen:phrase 3ps_usergroup_ranks_calculation_style}</label>
                        <xen:radio name="{$fieldPrefix}[{$preparedOption.option_id}][style][member_list]" selected="{$preparedOption.option_value.style.member_list}">
                            <xen:option value="0">{xen:phrase 3ps_usergroup_ranks_fixed}</xen:option>
                            <xen:option value="1">{xen:phrase 3ps_usergroup_ranks_dynamic}</xen:option>
                        </xen:radio>
                    </li>
                    <li>
                        <label for="{$fieldPrefix}[{$preparedOption.option_id}][value][member_list]">{xen:phrase 3ps_usergroup_ranks_value}</label>
                        <ul>
                            <li>
                                <xen:spinbox name="{$fieldPrefix}[{$preparedOption.option_id}][value][member_list]" value="{$preparedOption.option_value.value.member_list}" min="0" />
                            </li>
                        </ul>
                    </li>
                </ul>
            </li>
        </ul>
        <ul>
            <li>
                <label class="boldText">{xen:phrase 3ps_usergroup_ranks_in_member_cards}:</label>
                <ul>
                    <li>
                        <label for="{$fieldPrefix}[{$preparedOption.option_id}][style][member_cards]">{xen:phrase 3ps_usergroup_ranks_calculation_style}</label>
                        <xen:radio name="{$fieldPrefix}[{$preparedOption.option_id}][style][member_cards]" selected="{$preparedOption.option_value.style.member_cards}">
                            <xen:option value="0">{xen:phrase 3ps_usergroup_ranks_fixed}</xen:option>
                            <xen:option value="1">{xen:phrase 3ps_usergroup_ranks_dynamic}</xen:option>
                        </xen:radio>
                    </li>
                    <li>
                        <label for="{$fieldPrefix}[{$preparedOption.option_id}][value][member_cards]">{xen:phrase 3ps_usergroup_ranks_value}</label>
                        <ul>
                            <li>
                                <xen:spinbox name="{$fieldPrefix}[{$preparedOption.option_id}][value][member_cards]" value="{$preparedOption.option_value.value.member_cards}" min="0" />
                            </li>
                        </ul>
                    </li>
                </ul>
            </li>
        </ul>
    </dd>
</dl>