Extension:Header Tabs
From MediaWiki.org
|
Release status: beta |
|
|---|---|
| Implementation | Parser function, User interface |
| Description | Extension replaces top-level headers with tabs (using YUI) |
| Author(s) | Sergey ChernyshevTalk |
| Last Version | 0.6.6 (2009-09-13) |
| License | BSD |
| Download | SVN |
| Example | interest page on Ardorado.com |
|
check usage (experimental) |
|
This extension transforms top-level MediaWiki headers into tabs using Yahoo! YUI library.
It was originally developed for Ardorado.com and maintained by Semantic Communities LLC.
Contents |
[edit] Usage
To enable tabs on a page after you installed the extension, you need to add
<headertabs/>
tag into the page in place where the last tab should end (everything below this tag will be shown under the tab view). Most of the time, though, you'll want to put it at the bottom of the page.
In addition to that, page should have top level headers defined in it like this:
= Header title =
[edit] Linking to tabs
To allow users to switch to specific tab by just clicking a link on the page (in another tab or outside tab view), you can call the {{#switchtablink}} parser function like this:
{{#switchtablink:Tab Name|Link Text|Page Name}}
This will create a link to the tab with the name "Tab Name", and the text of the link will read "Link Text". If you want the link to a point to a tab on some page other than the current one, you can optionally add the third parameter, "Page Name".
[edit] Semantic MediaWiki factbox
In addition to user-defined tabs, Header Tabs converts Semantic MediaWiki factbox into a tab and adds it as a last tab in tab view.
[edit] Example
Some text above the tab view
= First section header =
This will be displayed on first tab
{{#switchtablink:Second section header|Click here to go to the next tab...}}
= Second section header =
This will be displayed on second tab
<headertabs/>
= Third section header =
This will be always displayed under the tab view because it's below <nowiki><headertabs/></nowiki> tag.
Header titles get automatically converted into tab titles.
[edit] Download instructions
[edit] Installing from SVN
To get code from Subversion, just type
svn checkout http://svn.wikimedia.org/svnroot/mediawiki/tags/extensions/HeaderTabs/REL_0_6_6/ HeaderTabs
Old releases on Google Code are available here:
http://mediawiki-header-tabs.googlecode.com/svn/tags/
|
You can also download this extension as part of Semantic Bundle, which includes Header Tabs version 0.6.6, as well as some other very interesting extensions. |
[edit] Installation
Download the code into $IP/extensions/ folder. Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.
Add the following to LocalSettings.php:
require_once("$IP/extensions/HeaderTabs/HeaderTabs.php");
[edit] Skin modification
If you want to override YUI skin, feel free to modify your skin and assign skin class (e.g. yui-skin-sam) to <body> tag. See YUI skinning documentation for more details.
[edit] Configuration parameters
The following parameters can be changed in the LocalSettings.php file below the require_once(...):
[edit] $htYUIBase
$htYUIBase variable defines path to the YUI installation. By default it uses YUI hosted on Yahoo! servers, but you can download it to /yui-2.5.1/ on your site and point to it like this:
$htYUIBase = '/yui-2.5.1/build/';
Keep in mind that Yahoo! hosts YUI at their fast CDN (with another domain which might speed up downloads), does a very good job at enforcing the cache of these files and so on, plus they might be cached in users browser (because many people visit http://www.yahoo.com) already by the time he hits your servers. Don't think it's necessarily better for you to host it yourself.
[edit] $htUseHistory
$htUseHistory variable defines if tab navigation should be tracked within the URL updating the hash value, by default history is used.
$htUseHistory = false; // disable tab navigation history
[edit] Known issues
- Table of contents doesn't make much sense when tabs are used. Right now you can disable it with
__NOTOC__. Later versions might force this.
[edit] Helpful hints
If the extension HeaderTabs does not work in your installation, check the following
- make sure you have a file
extensions/HeaderTabs/skins/headertabs.js; you might have inadvertently changed the name toextensions/HeaderTabs/skins/headertabs.js.txt - compatibilities between HeaderTabs and yui:
- HeaderTabs 0.6.6: yui 2.5.1 ok, yui 2.5.2 ok, yui 2.6.0 incompatible, yui 2.7.0b incompatible
[edit] CHANGES
| Version | Date | Description |
|---|---|---|
| 0.6.6 | 2009-09-13 | Fixed compatibility issues with MW 1.16 |
| 0.6.5 | 2008-09-02 | Fixed the way another target is handled |
| 0.6.4 | 2008-07-29 | Added 3rd param to {{#switchtab}} to allow focusing on different header |
| 0.6.3 | 2008-07-02 | Fixed a bug with switchtablink using bogus $inout variable instead of $outout. Thanks for user report. |
| 0.6.2 | 2008-06-25 | Worked around MediaWiki bug that inserts </p><p> in front of switchlinktab. |
| 0.6.1 | 2008-06-20 | Fixed a problem with IE7 opening CSS files loaded withing iframe in source viewer - now I use blank HTML file instead |
| 0.6 | 2008-05-09 | Added {{#switchtablink}} parser function |
| 0.5 | 2008-05-05 | Upgraded to YUI version 2.5.1 which has History module in production, not beta |
| 0.4 | 2008-04-08 | Rolled back 0.2 changes because of some weird problem with cache. Not loading history JS library if $htUseHistory is set to false |
| 0.3 | 2008-04-08 | Now History can be disabled using $htUseHistory variable (true by default) |
| 0.2 | 2008-04-08 | All JS and CSS are inserted only when page has tabs |
| 0.1 | 2008-03-20 | Initial public release |
[edit] Support
The best way to seek help with this extension is to send your questions to our development google group
http://groups.google.com/group/semacomm-dev
extension maintainer and active users and contributors are on this list and will be able to help you.
[edit] Sites using this extension
- Ardorado.com
- All sites on Referata.com hosting
- Cause Caller Wiki
- LexWiki
- The Music Snob
- The Seventh Sun Wiki
- Venicewiki.org
- The Old Cookery Book
- PinataIsland.info - Viva Pinata Wiki
- vraywiki.com
- Wereldpagina
- Elder Scrolls Fanon
- Men of War - Wiki