Extension:ExtTab

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
Ext Tab
Release status: beta
Implementation Parser extension
Description Tab control based on ExtJS
Author(s) Ning Hu (dch), Justin Zhang, Jesse Wang (Ningtalk)
Latest version 1.0
MediaWiki 1.13.5+ (tested up to 1.16.x), less than 1.17
PHP PHP 5.0+ installed and working
License GPL & ExtJS license
Download
Translate the ExtTab extension if it is available at translatewiki.net
Check usage and version matrix.

Installation[edit]

Edit $IP/LocalSettings.php and add:

   include_once('extensions/ExtTab/includes/ET_Initialize.php');

Usage[edit]

Altogether two parser functions and one parser hook are implemented

'embedwiki' parser hook[edit]

  • parser functions inside other will cause parser frame conflict
    • a possible solution for now is to use escape chars, e.g. '|'
  • we just implement this hook to skip the escape chars
  • e.g.
{{#pf1
| opt = text
| body = 
<embedwiki>
	{{#pf2
	| opt = ...
	|}}
</embedwiki>
|}}

'tab' parser function[edit]

tab widget for wiki, the basic syntax is

{{#tab:
| name = widget name
| options = predefined widget options

| tab <id>.body = tab header in plain text
tab content in wiki text
| tab <id>.option = predefined tab options (optinal)

| tab <id>.body = [[internal page link | tab header (if necessary)]]
|}}
  • name, name of the widget
  • options, options for the widget
    • height, height for the widget
    • width, width for the widget
  • tab id, tab id to specify a tab in the widget
    • .body, body of the tab
      • the first line is in plain text, which means the tab header, and tab body in wiki text is followed
      • an internal page link, the tab content will lazy load when actived, use the body of internal page
        • javascript actions for the body are not loaded for this version
    • .option, tab options are not currently defined

Sample[edit]

E.g., Sci-Fi movies

{{#tab:
|options=width:700;height:500

|tab0.body=2000
<embedwiki>
{| class="wikitable"
|-
! Title !! Director !! Cast !! Notes
|-
|'''''[[The 6th Day]]'''''||[[Roger Spottiswoode]]||[[Arnold Schwarzenegger]], [[Tony Goldwyn]], [[Michael Rapaport]]|| 
|-
|'''''[[X-Men (film)|X-Men]]'''''||[[Bryan Singer]]||[[Hugh Jackman]], [[Patrick Stewart]], [[Ian McKellen]] || <ref>Won a [[Saturn Award]] for Best Science Fiction Film.</ref>
|-
|}
</embedwiki>
|tab1.body=2001
<embedwiki>
{| class="wikitable"
|-
! Title !! Director !! Cast !! Notes
|-
|'''''[[Vanilla Sky]]'''''||[[Cameron Crowe]]||[[Tom Cruise]], [[Penélope Cruz]], [[Cameron Diaz]] || 
|-
|}
</embedwiki>
|tab2.body=[[2002 sci-fi|2002]]
|}}

JS framework conflict[edit]

ExtTab uses ExtJS js framework, which may have js conflict with other js frameworks.

See also[edit]

ExtJS

License of ExtJS[edit]

ExtJS license