User:Mtew/Folder Tabs

From Guild Wars Wiki
Jump to navigationJump to search

Usage[edit]

Construct a row of links that looks like a set of file folder tabs to switch between pages.

Normally, the tab list is set up on a separate page that is transcluded in each of the pages linked to.

Features[edit]

  • Up to eleven tabs can be displayed.
    • Automatic wrapping of long, multi-word labels can be suppressed.
  • The background of the tab changes when that tab is selected.
    • The background colors for each individual tab may be set individually.
    • The background colors tor tabs that do not specify colors may be set.
  • The pages that include the tab row do not have to know anything about the order of the tab entries.
    • This greatly simplifies maintaining the tab list.
    • For unusual situations, there is a 'Select' parameter that takes the value of the tab's display text.
  • Sub-pages are supported.

Examples[edit]

{{User:Mtew/Folder Tabs
| page1={{FULLPAGENAME}}|This Page
| page2=That page|That page
}}

  This Page   That page  


{{User:Mtew/Folder Tabs
| page1={{FULLPAGENAME}}|This Page
| page2=That page|That page
| wrap=no }}

  This Page   That page  


Parameters[edit]

For page selection[edit]

Select
Set this to the display text to force the selection of a tab.
level
The relative level of the page displayed to the link in the tab.  Used when matching on sub-pages.

For constructing all tabs[edit]

BackgroundColor
The color for the background between tabs.  The default is white (#FFFFFF).
BorderColor
The color for the tab border.  The default is black (#000000).
Corner
The radius of the upper corners of tabs on browsers that support this feature.
SelectedColor
The background color for selected tabs that do not specify a SelectedColor.
UnselectedColor
The background color for un-selected tabs that do not specify an UnselectedColor.
wrap
Set this parameter to 'no' to suppress wrapping of the display text in all tabs.

For constructing individual tab <n>[edit]

Unnamed positional parameter <n>
The text to be displayed on the tab.
page<n>
The FULLPAGENAME of the page to link to.  This must not be a link to the page.  It is used to construct a normal link on the tab.
link<n>
The name of an off-site page to link to.  This must not be a link to the page.  It is used to construct a special link on the tab.

Tab selection[edit]

The selection of which tab to high-light is done automatically by comparing the {{FULLPAGENAME}} of the page being displayed with the page<n> parameter's value.  The matching is textual, not logical, so variations in spelling and redirects do cause match failures.

To support tabs in sub-pages, the level parameter can be used to modify the {{FULLPAGENAME}} being checked. For example, if the tab selection is to be based on the parent page of a sub-page, rather than on the sub-page itself, 'level=/..' would be needed.

For those cases where page name matching does not work, the Select parameter can be set to the display text of the desired tab.  This does not disable the page match selection.  (Specifying level can be used to force page name matching failure.)

Notes[edit]

  • The parser funcions (those thingies that start with '#') strip white space from the beginning and end of each of their parameters.  This can cause problems because line breaks are very important when trying to build WIKI tables.  The work around is to put a literal space (&#x20;) before the line break that is to be preserved.  It is also necessary to 'escape' all other WIKI special constructs ({{, | and }}) in parser function parameters.
  • There are a few undocumented keyword parameters.
  • CSS support is included but is considered experimental at this time.
  • Most of the formatting details are specified by the internal Template:User:Mtew/Folder Tab.