Requirement:
XThreads
This is a simple example how to use tabs in our postbit.
Basically, we need Tabs Title and Tabs Contents.
Textbox for Tabs Title:
- Title: Tabs 2 Title
- Key: tc2
- Applicable Forums: select forum that we want to apply the tabs
- Input Field Type: Textbox
- Maximum Text Length: 20
Modify it as our needs. Max chars for tabs title.
- Editable by / Required Field?: Everyone
- Blank Replacement Value:
Because this field isn't a required field, and the additional tabs contents isn't a required field as well, so we need to set the default tabs title. This is the default tabs title for contents 2. This default tabs title will be displayed if user didn't fill tabs 2 title, but they filled tabs 2 contents. Modify it as our needs.
The reason why we put the conditional there is, this tabs shouldn't be displayed if there is no contents for this tabs.
- Display Format :
Multiline Textbox for Tabs Contents:
- Title: Contents 2
- Key: tc2c
- Applicable Forums: select forum that we want to apply the tabs
- Input Field Type: Multiline Textbox
- Editable by / Required Field?: Everyone
- Display Parsing : Use MyBB Parser (MyCode)
- MyBB Parser Options : Check all except Allow HTML.
- Display Format :
Repeat the two steps above as our needs. Use different key.
In this example, we will use the jQuery tabs. If we have another tabs system, just use it.
There is at least two template we need to edit for this:
- showthread template or template_prefix_showthread template.
Add this in the header of the template:
If we already have jQuery attached to all pages, remove line #1. Or, edit it if we have a different location for our jQuery.
In this example, we have the jQuery in our jscripts folder. Maybe we can use a newest jQuery version.
For the ID in line #17, maybe we need to modify it, depends on what ID we use for our tabs contents.
- postbit_first or template_prefix_postbit_first template.
An example how to apply the tabs title and tabs contents in this template.
In the example above, we add two tabs title and tabs contents.
Screenshots:
Tabs 1 (Main Tab) - Tabs 2 - Tabs 3
Live Demo:
http://www.14.mynie.co.cc/forumdisplay.p...http://www.14.mynie.co.cc/forumdisplay.php?fid=33&filtertf_prefix=Post
Try it yourself:
http://www.14.mynie.co.cc/newthread.php?fid=33