Template:RootPage/doc View history

(Added SubPage2)
Line 18: Line 18:


== Related versions ==
== Related versions ==
A special version of this template is {{tl|RootPage2}} where it operates the same and {{tlc|RootPage}} except if the root page is '''USA''' it uses the second subpage. This enables the automation of [[USA/CommonState]] to display normally if it is the sample template or deployed on an actual state page without further modifications.
;{{tl|RootPage2}}
:An adaptation of {{tlc|RootPage}} except if the root page is '''USA''' it uses the second subpage. This enables the automation of [[USA/CommonState]] template suite to display the state name on pages and the template itself will display '''CommonState'''.
 
;{{tl|BasePage2}}
:It operates half way between {{tlc|RootPage2}} and {{tlc|BasePage2}}. It is highly customized for the [[USA/CommonState]] template suite. The pages with "USA" respond the same, but all other pages return the {{tl|BASEPAGENAME}}, with the exception of pages with "Main" (which stops at the {{tlc|BASEPAGENAME}} one level above it). This enables the automation of [[USA/CommonState]] to display normally if it is deployed on test pages. The state page can then be tested without affecting the original page and after testing is complete it can be moved along with all the subpages to the primary page.
 
;{{tl|SubPage2}}
:It too is highly customized for the [[USA/CommonState]] template suite. On pages with USA/CommonState, it will display the 3rd subpage (if present), otherwise it is blank. For pages with "Main", it will display the subpage above "Main", otherwise it will display the subpage.
 


A related version of this template is {{tl|BasePage2}} where it operates the same as {{tlc|RootPage2}} except it uses the basepage with a twist. It is highly customized for the CommonState template pages. The pages with "USA" respond the same, but all other pages return the {{tl|PAGENAME}}, with the exception of pages with "Main" (which stops at the basepage one level above it). This enables the automation of [[USA/CommonState]] to display normally if it is deployed on test pages. The state page can then be tested without affecting the original page and after testing is complete it can be moved along with all the subpages to the primary page.
{| class= "wikitable"
{| class= "wikitable"
! Pagename
! Pagename
! <nowiki>{{RootPage2}}</nowiki>
! <nowiki>{{RootPage2}}</nowiki>
! <nowiki>{{BasePage2}}</nowiki>
! <nowiki>{{BasePage2}}</nowiki>
! <nowiki>{{SubPage2}}</nowiki>
|-
|-
| USA/CommonState/Test
| USA/CommonState/Test
| {{RootPage2|USA/CommonState/Test}}
| {{RootPage2|USA/CommonState/Test}}
| {{BasePage2|USA/CommonState/Test}}
| {{BasePage2|USA/CommonState/Test}}
| {{SubPage2|USA/CommonState/Test}}
|-
|-
| USA/CommonState
| USA/CommonState
| {{RootPage2|USA/CommonState}}
| {{RootPage2|USA/CommonState}}
| {{BasePage2|USA/CommonState}}
| {{BasePage2|USA/CommonState}}
| {{SubPage2|USA/CommonState}}
|-
|-
| USA/CommonState/Test/Test 2
| USA/CommonState/Test/Test 2
| {{RootPage2|USA/CommonState/Test 2}}
| {{RootPage2|USA/CommonState/Test 2}}
| {{BasePage2|USA/CommonState/Test 2}}
| {{BasePage2|USA/CommonState/Test 2}}
| {{SubPage2|USA/CommonState/Test 2}}
|-
|-
| Arizona/To do
| Arizona/To do
| {{RootPage2|Arizona/To do}}
| {{RootPage2|Arizona/To do}}
| {{BasePage2|Arizona/To do}}
| {{BasePage2|Arizona/To do}}
| {{SubPage2|Arizona/To do}}
|-
|-
| Arizona/Test/To do
| Arizona/Test/To do
| {{RootPage2|Arizona/Test/To do}}
| {{RootPage2|Arizona/Test/To do}}
| {{BasePage2|Arizona/Test/To do}}
| {{BasePage2|Arizona/Test/To do}}
| {{SubPage2|Arizona/Test/To do}}
|-
|-
| Arizona/Test/To do/Main
| Arizona/Test/To do/Main
| {{RootPage2|Arizona/Test/To do/Main}}
| {{RootPage2|Arizona/Test/To do/Main}}
| {{BasePage2|Arizona/Test/To do/Main}}
| {{BasePage2|Arizona/Test/To do/Main}}
| {{SubPage2|Arizona/Test/To do/Main}}
|-
|-
| Arizona/Test/To do/Main/Preload
| Arizona/Test/To do/Main/Preload
| {{RootPage2|Arizona/Test/To do/Main/Preload}}
| {{RootPage2|Arizona/Test/To do/Main/Preload}}
| {{BasePage2|Arizona/Test/To do/Main/Preload}}
| {{BasePage2|Arizona/Test/To do/Main/Preload}}
| {{SubPage2|Arizona/Test/To do/Main/Preload}}
|-
|-
| Arizona/To do/Main/Preload
| Arizona/To do/Main/Preload
| {{RootPage2|Arizona/To do/Main/Preload}}
| {{RootPage2|Arizona/To do/Main/Preload}}
| {{BasePage2|Arizona/To do/Main/Preload}}
| {{BasePage2|Arizona/To do/Main/Preload}}
| {{SubPage2|Arizona/To do/Main/Preload}}
|}
|}



Revision as of 14:58, 18 July 2014

This is a documentation subpage for Template:RootPage.
It contains usage information, categories and other content that is not part of the original template page.

This template uses the #titleparts parser function extension to extract only the root of the page name.

Usage

Place {{RootPage}} where the root of the current page name is desired. An optional parameter is a pagename other than the current pagename.

Pagename {{RootPage}}
USA/CommonState/Test USA
USA USA

Related versions

{{RootPage2}}
An adaptation of Template:Tlc except if the root page is USA it uses the second subpage. This enables the automation of USA/CommonState template suite to display the state name on pages and the template itself will display CommonState.
{{BasePage2}}
It operates half way between Template:Tlc and Template:Tlc. It is highly customized for the USA/CommonState template suite. The pages with "USA" respond the same, but all other pages return the {{BASEPAGENAME}}, with the exception of pages with "Main" (which stops at the Template:Tlc one level above it). This enables the automation of USA/CommonState to display normally if it is deployed on test pages. The state page can then be tested without affecting the original page and after testing is complete it can be moved along with all the subpages to the primary page.
{{SubPage2}}
It too is highly customized for the USA/CommonState template suite. On pages with USA/CommonState, it will display the 3rd subpage (if present), otherwise it is blank. For pages with "Main", it will display the subpage above "Main", otherwise it will display the subpage.


Pagename {{RootPage2}} {{BasePage2}} {{SubPage2}}
USA/CommonState/Test CommonState USA/CommonState Test
USA/CommonState CommonState USA/CommonState
USA/CommonState/Test/Test 2 CommonState USA/CommonState Test 2
Arizona/To do Arizona Arizona To do
Arizona/Test/To do Arizona Arizona/Test To do
Arizona/Test/To do/Main Arizona Arizona/Test To do
Arizona/Test/To do/Main/Preload Arizona Arizona/Test To do
Arizona/To do/Main/Preload Arizona Arizona To do