xF2 Tabbed Options

  • Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Radio

    ven0m

    Administrator
    Staff member
    Administrator
    Moderator
    Platinum
    xenForo 2.x.x
    xenForo 1.x.x
    Contributor
    vBulletin All Access Pass
    The Chest
    Verified
    Ultra Platinum VIP
    Platinum VIP
    Gold VIP
    Silver VIP
    Premium
    Member
    Jul 17, 2005
    20,497
    7,735
    321
    localhost
    Heisenberg submitted a new resource:

    - Tabbed Options

    This guide will allow you to have a single option group for all your options, separating them into tabbed sections rather than forcing users to change option groups.

    Examples

    You must be registered for see images



    You must be registered for see images



    Code Event Listener
    Event:
    templater_macro_pre_render
    Event Hint: admin:eek:ption_macros:eek:ption_form_block
    Execute Callback:...

     

    ven0m

    Administrator
    Staff member
    Administrator
    Moderator
    Platinum
    xenForo 2.x.x
    xenForo 1.x.x
    Contributor
    vBulletin All Access Pass
    The Chest
    Verified
    Ultra Platinum VIP
    Platinum VIP
    Gold VIP
    Silver VIP
    Premium
    Member
    Jul 17, 2005
    20,497
    7,735
    321
    localhost
    Heisenberg updated with a new update entry:



    Alternative macro HTML in order to create full-width separators instead of tabs.
    Code:
    <xf:macro name="option_form_block" arg-group="" arg-options="!" arg-containerBeforeHtml="">
        <xf:if is="$options is not empty">
            <xf:form action="{{ link('options/update') }}" ajax="true" class="block">
                {$containerBeforeHtml|raw}
                <div class="block-container">
                    <h3 class="block-formSectionHeader">
                        {{ phrase('general_options') }}...

     

    ven0m

    Administrator
    Staff member
    Administrator
    Moderator
    Platinum
    xenForo 2.x.x
    xenForo 1.x.x
    Contributor
    vBulletin All Access Pass
    The Chest
    Verified
    Ultra Platinum VIP
    Platinum VIP
    Gold VIP
    Silver VIP
    Premium
    Member
    Jul 17, 2005
    20,497
    7,735
    321
    localhost
    Heisenberg updated with a new update entry:



    Fix: Updated function arguments for the code event listener​

     

    ven0m

    Administrator
    Staff member
    Administrator
    Moderator
    Platinum
    xenForo 2.x.x
    xenForo 1.x.x
    Contributor
    vBulletin All Access Pass
    The Chest
    Verified
    Ultra Platinum VIP
    Platinum VIP
    Gold VIP
    Silver VIP
    Premium
    Member
    Jul 17, 2005
    20,497
    7,735
    321
    localhost
    Heisenberg updated with a new update entry:



    Alternative macro HTML in order to create full-width separators instead of tabs.
    Code:
    <xf:macro name="option_form_block" arg-group="" arg-options="!" arg-containerBeforeHtml="">
        <xf:if is="$options is not empty">
            <xf:form action="{{ link('options/update') }}" ajax="true" class="block">
                {$containerBeforeHtml|raw}
                <div class="block-container">
                    <h3 class="block-formSectionHeader">
                        {{ phrase('general_options') }}...

     

    ven0m

    Administrator
    Staff member
    Administrator
    Moderator
    Platinum
    xenForo 2.x.x
    xenForo 1.x.x
    Contributor
    vBulletin All Access Pass
    The Chest
    Verified
    Ultra Platinum VIP
    Platinum VIP
    Gold VIP
    Silver VIP
    Premium
    Member
    Jul 17, 2005
    20,497
    7,735
    321
    localhost
    Heisenberg updated with a new update entry:



    I've updated the macro HTML code and included code for both tabbed and spaced options, with default being spaced, due to compatibility.

    Furthermore, the display orders now split every 1000, instead of every 100, and adds support for the <hr class="formRowSep" /> every 100 just like standard XF2 options.

    If you are using this code in your addon, you should not simply paste this new macro code without also fixing all your options to multiply their display order by 10.

     

    ven0m

    Administrator
    Staff member
    Administrator
    Moderator
    Platinum
    xenForo 2.x.x
    xenForo 1.x.x
    Contributor
    vBulletin All Access Pass
    The Chest
    Verified
    Ultra Platinum VIP
    Platinum VIP
    Gold VIP
    Silver VIP
    Premium
    Member
    Jul 17, 2005
    20,497
    7,735
    321
    localhost
    Resource has been updated with a new update entry:



    If you use this in your add-on, you probably use it in multiple. Changing the template is a pain for each of them, so now the template has been made 100% universal, with the configuration switched to the PHP code.

    I've also updated the guidelines for the listener to use a single Listener.php file instead of a new file per listener, it doesn't really matter but it's a standard I use so