Subject Information

Category Name XenForo 2.x Development Tutorials\/Tools
TOPIC TITLE Tabbed Options
Thread starter AnimeHaxor
Start date
Replies
Views
First message reaction score
LAST MESSAGE BY AnimeHaxor

AnimeHaxor

Retro-NulledTeam
Staff member
Administrator
Moderator
Registered
Joined
Nov 22, 2015
Messages
6,354
Reaction score
42,360
Points
113
Website
www.nullscripts.net
Site Script
XenForo
AnimeHaxor submitted a new resource:

Tabbed Options - Add tabs to your addon's options page

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

View attachment 11744

View attachment 11743

Code Event Listener
Event:
templater_macro_pre_render
Event Hint: admin:eek:ption_macros:eek:ption_form_block
Execute Callback: Your\Namespace\XenForo2\EventListener\MacroRender :: preRender
PHP:
<?php

namespace...

Read more about this resource...
 

AnimeHaxor

Retro-NulledTeam
Staff member
Administrator
Moderator
Registered
Joined
Nov 22, 2015
Messages
6,354
Reaction score
42,360
Points
113
Website
www.nullscripts.net
Site Script
XenForo
AnimeHaxor updated Tabbed Options with a new update entry:

Tabbed Options 2: Separator Boogaloo

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') }}
				</h3>
				<div class="block-body">
					<xf:foreach...

Read the rest of this update entry...
 

AnimeHaxor

Retro-NulledTeam
Staff member
Administrator
Moderator
Registered
Joined
Nov 22, 2015
Messages
6,354
Reaction score
42,360
Points
113
Website
www.nullscripts.net
Site Script
XenForo
AnimeHaxor updated Tabbed Options with a new update entry:

Tabbed Options 3: This Time The Third One Is Actually Better

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.

Read the rest of this update entry...
 

Admin

Staff member
Administrator
Registered
Joined
Aug 21, 2015
Messages
12,849
Reaction score
55,801
Points
113
Age
47
Location
Egypt
Website
www.nullscripts.net
Site Script
XenForo
AnimeHaxor updated Tabbed Options with a new update entry:

HTML clean-up, universal template Add bookmark

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 :p

The main core of the HTML has also had code duplication reduced thanks to @truonglv

Read the rest of this update entry...
 

AnimeHaxor

Retro-NulledTeam
Staff member
Administrator
Moderator
Registered
Joined
Nov 22, 2015
Messages
6,354
Reaction score
42,360
Points
113
Website
www.nullscripts.net
Site Script
XenForo