v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

User:FJH/fjh tabs

From Dwarf Fortress Wiki
< User:FJH
Revision as of 23:11, 5 May 2009 by FJH (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Introduction   Generated Worlds   History   Exchange   Wiki Work   Resources   Updates   Using Tabs   Tabs    

How to Use the PageTab Template[edit]

It probably goes without saying, but templates make this wiki much better than it could ever be on its own. They employ advanced and, typically, standardized methods of information presentation and purport aesthetic elegance; but, they are not all intuitive in and of themselves. Some require basic knowledge of how other other templates work to understand how these higher-order templates work; and, some require precise formatting just to accommodate basic display. PageTabs is something like that, whose difficulty is compounded by the template's main definition page itself lacking a set of instructions, and a severe lack of demonstrated examples. As far as I know, the only user and only page that has employed this organized template before myself belongs to Vaevictus, and it is from his user page by which I understand anything about how this template works.


The essential idea behind PageTabs is that a variety of related pages can be displayed from a single page, with each one having a visible bookmark lined-up above the current page as a section header. It is just like "tabbed browsing" only that the pages that you can "switch tabs" between are mostly fixed. At the moment, there is no meta-formatting template that allows for different tab design. The actual operation of tabbed wiki-ing gives the impression of using frames.


To start, check the code behind this page (try editting it) to get an idea of the main tab definition structure.


From the page you wish to include in tabs - we shall call that page WIKIPAGE - you first should create a page called WIKIPAGE/tabs. Create WIKIPAGE/tabs and in this page include something along the following lines.

{{PageTabs
  |[[WIKIPAGE|LABEL1]]
  |[[WIKIPAGE/PAGE2|LABEL2]]
  |[[WIKIPAGE/tabs|LABEL3]]
  |This={{{This|#}}}
}}

This example creates a header with three tabs on it. The first tab links to the main WIKIPAGE on which the tab system shall appear and its tab uses the text LABEL1; subsequent tabs link to respectively subsequent pages and use respectively subsequent labels. Note that each tab is set up to look as if one is typing an external hyperlink! Also note that I have included the last tab as a link to the WIKIPAGE/tab page that contains the definition tag for the rest of this page's tab system. The purpose of this link is for easy access at a later date, to add or remove tabs from the header. This is not necessary, at the end or anywhere, but will be helpful. The specific newline format of the PageTab tag demonstrated here is also not absolutely necessary; it is used for emphasis.


The This line assigns what tab will be indicated on this page, which part of the tab menu will be highlighted when you click on that tab. Assume # is a number where the range is 1 to the maximum number of tabs used. Messing up this line by including a number that refers to the wrong tab or to a tab which does not exist will not mess up navigation, just display, at least right now. If you are connecting to WIKIPAGE/tabs, the number MUST represent the correct tab. Use copious amounts of Show Preview until it looks pleasing before the final Save Page.


Now navigate to WIKIPAGE and, considering other formatting on the page, edit the page and, somewhere on it, include the tag:

{{WIKIPAGE/tabs|This=1}}

Including this line will display the tab header on this page and identify it as the main page for the tab system. When you first see the menu, you will noticed that the text on all tabs excluding the first one (the one you are on) will be displayed like they are broken links. To create and indoctrinate these pages into the system of tabbed browsing, click on the tab to navigate to the nonexistent tab's page and edit it to include the above text, with the appropriate incremented number in the This= line. As opposed to the main definition tag, this number has to be correct, else the wrong tab could be displayed. When you preview the page now, it should include the tab menu you defined on WIKIPAGE/tabs. If you are using my advice and include a tab to WIKIPAGE/tabs, you will still need to edit it in this same manner before it displays the page.


When no tabs show as broken links and all tabs display a unique body of text under the same tabbed header, you are done.