Tabs Macro
Creates tabbed view for specified content areas wrapped in DIVs with unique ids |
Type | XAR |
Category | |
Developed by | Roman Muntyanu, Vistoria Volkova |
Active Installs | 43 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Table of contents
Description
Usage
- Define where tabs should be rendered {{tabs idsToLabels='tabId1=Tab One, tabId2=Tab Two, ..., tabIdN=Tab N' /}}
- Define tabs content in (%id="<unique tab id>"%)(((<tab content here>))):
(%id="tabId1"%)(((Tab 1 Content)))
(%id="tabId2"%)(((Tab 2 Content)))
...
(%id="tabIdN"%)(((Tab N Content)))
Parameters definition
Name | Optional | Allowed values | Default value | Description |
---|---|---|---|---|
idsToLabels | no | String | - | This parameter required a comma-separated tab id to tab label values sting formatted like idsToLabels='tabId1=Tab One, tabId2=Tab Two, tabId3=TabThree'. |
Known issues
- Tab size is fixed (Toucan Skin), labels that do not fit will get trimmed ("Tab name too long" section of the installed macro home-page)
- Layout consistency is dependent on white-spaces ("Interesting layout bugs" section of the installed macro home-page)
Examples
Example 1
Code
(%id="tabId11"%)((({{box cssClass="tabId11div"}}
First tab!
{{/box}}
I can post any content here
)))
(%id="tabId12"%)((({{box cssClass="tabId12div"}}
Second tab!
{{/box}}
And here too
)))
Result
Tab "My xwiki-wide tabs"
Tab "My working tabs "
Example 2
Code
(%id="sql2key1"%)(((
{{code language="sql"}}
SELECT COUNT(ctg_id) AS col_0_0_ FROM categories
-- some text
-- several lines
-- of comments
-- describing this sql query
{{/code}}
)))
(%id="sql2key2"%)(((
{{code language="sql"}}
SELECT COUNT(ctg_id) AS col_0_0_ FROM categories2
-- another tab with text
-- Testing content overflow
-- Text below this box ...
-- ... should not get covered with it
-- just check this!!!
-- btw: no extra-paragraph has been added before the macro
{{/code}}
)))
Result in Toucan Skin
Tab "Small tab"
Tab "Second large tab with large label"
Result in Colibri Skin
Tab "Small tab"
Tab "Second large tab with large label" (in colibri skin)
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.
You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:
- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki
Release Notes
v1.0.2
Fixed excessive empty lines added before tabs.