Template:Page tabs: Difference between revisions
wiki.andrealphusgames>GKFX Update from sandbox |
m 1 revision imported |
||
(No difference)
|
Latest revision as of 17:14, 1 October 2021
{{#switch:<translate></translate> | = {{#if:{{#ifexpr: ( {{#ifeq:page tabs|doc|1|0}} or ( {{#ifeq:{{#titleparts:template:page tabs|-1|-2}}|doc|1|0}} and {{#if:{{#translation:}}|1|0}} ) )|1|}}
|
{{#ifeq:show |show
| Template:Mbox }}{{#if: | | {{#ifexist:Template:Page tabs | [[Category:{{#switch:Template | Template | Project = Template | Module = Module | User = User | #default = MediaWiki }} documentation pages{{#translation:}}]] | [[Category:Documentation subpages without corresponding pages{{#translation:}}]] }} }} | }}
| #default=
{{#switch:
| = {{#if:{{#ifexpr: ( {{#ifeq:page tabs|doc|1|0}} or ( {{#ifeq:{{#titleparts:template:page tabs|-1|-2}}|doc|1|0}} and {{#if:{{#translation:}}|1|0}} ) )|1|}}
|
{{#ifeq:show |show
| Template:Mbox }}{{#if: | | {{#ifexist:Template:Page tabs | [[Category:{{#switch:Template | Template | Project = Template | Module = Module | User = User | #default = MediaWiki }} documentation pages{{#translation:}}]] | [[Category:Documentation subpages without corresponding pages{{#translation:}}]] }} }} | }}
| #default=
Lua error: expandTemplate: template loop detected.
}} }}
Script error: No such module "Shortcut".
Page Module:Message box/ombox.css has no content.File:Lua-Logo.svg | This template uses Lua: |
Script error: No such module "Uses TemplateStyles". This template is not for use in articles.
This template provides a menu of tabs for linking different pages. Any number of tabs can be specified. Whichever tab is the current page is indicated by "This =" and the tab number to mark as the current tab. "This =" makes the specified tab white instead of blue. You can add links to pages which don't have tabs on them; for example, the "main page" link in the examples goes to the main page of Wikipedia.
In the examples below, change "Example" to whatever user name it actually was, and "Subpage 1", etc., to the page names you will add.
Example
{{Page tabs | NOTOC = true | [[User:Example]] | [[User:Example/Subpage 1]] | [[User:Example/Subpage 2|Second subpage]] | [[User:Example/Subpage 3]] | This = {{{This|1}}} }}
"This =" makes the default white tab page the first example. So if you don't put 'This=' on the page, the first tab would be white regardless of which page they were looking at. The first parameter suppresses the table of contents.
Now, you'd save that page, let's say it was called [[User:Example/tabs]]. You'd then go to each page starting with [[User:Example]] and put the template at the top of them in the form {{User:Example/tabs|This=1}}, and use the same thing but use This=2 instead of This=1 on "Subpage 2", and so on for This=3, etc.
An example has been done for this page at Template:Page tabs/tabs. Do not use this directly in your own set up, it is strictly for demonstrating how this works and documenting its use. Examine the page and the source to understand how to use this functionality.
Here's how it looks if you put it on the bottom of the page, which is why you generally put it at the top:
See also
{{#switch:Page tabs|sandbox|doc=|#default=
}}
{{#if:|
[[Category:Template documentation pages{{#translation:}}]] }}