Template:RootPage/doc View history

(testing)
(Added category to page)
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{doc subpage}}
{{doc subpage}}
<!-- ADD DOCUMENTATION BELOW THIS LINE -->
<!-- ADD DOCUMENTATION BELOW THIS LINE -->
This template uses the <code>#titleparts</code> parser function extension to extract only the root of the page name.
These templates uses the <code>#titleparts</code> parser function extension to extract only the root of the page name. This documentation covers 4 related templates.


== Usage ==
== Usage ==
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 {{tlx|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 or region name on pages and the template itself will display '''CommonState'''. It is like a template to obtain the state or territory name for other templates.
 
;{{tl|BasePage2}}
:It operates half way between {{tlx|RootPage2}} and <code><nowiki>{{BASEPAGENAME}}</nowiki></code>. It is highly customized for the [[USA/CommonState]] template suite. The pages with "USA/CommonState" respond with '''USA/CommonState''', but all other pages return the primary pagename of '''BasePageName''' or '''BasePageName/Test...''' (and exclude USA for regions). This enables the automation of [[USA/CommonState]] to display normally if it is deployed on test pages. The state or region 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. This function requires test pages only start from a subpage that begins '''/Test...''' below the initial page name for the state or territory. This also means no other section be created as a subpage that begins with '''/Test...'''.
 
:{| class="wikitable"
! Page name
! Intent
! Condition
|-
| California/Test
| Main test page for a new California template
| Good
|-
| California/Test city<br/>California/Testimonials
| A custom section to link from other current pages
| Bad. This page will cause link failures if {{tl|BasePage2}} is used on that page.
|}
 
;{{tl|SubPage2}}
:Like BasePage2 it is highly customized for the [[USA/CommonState]] template suite. On pages with USA/CommonState, it will display the primary/initial subpage (if present), which serves as the section page name, otherwise it is blank. For all other pages, it returns the first subpage after BasePage2.
 


{| class= "wikitable"
{| class= "wikitable"
! Pagename
! Pagename
! <nowiki>{{RootPage2}}</nowiki>
! <nowiki>{{RootPage2}}</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}}
| {{SubPage2|USA/CommonState/Test}}
|-
|-
| USA/CommonState
| USA/CommonState
| {{RootPage2|USA/CommonState}}
| {{RootPage2|USA/CommonState}}
| {{BasePage2|USA/CommonState}}
| {{SubPage2|USA/CommonState}}
|-
| USA/CommonState/Test/Test 2
| {{RootPage2|USA/CommonState/Test/Test 2}}
| {{BasePage2|USA/CommonState/Test/Test 2}}
| {{SubPage2|USA/CommonState/Test/Test 2}}
|-
| USA/Southeast/Test/Test 2
| {{RootPage2|USA/Southeast/Test/Test 2}}
| {{BasePage2|USA/Southeast/Test/Test 2}}
| {{SubPage2|USA/Southeast/Test/Test 2}}
|-
| USA/Southeast/Test 2
| {{RootPage2|USA/Southeast/Test 2}}
| {{BasePage2|USA/Southeast/Test 2}}
| {{SubPage2|USA/Southeast/Test 2}}
|-
| USA/Southeast/To do
| {{RootPage2|USA/Southeast/To do}}
| {{BasePage2|USA/Southeast/To do}}
| {{SubPage2|USA/Southeast/To do}}
|-
|-
| Arizona/To do
| Arizona/To do
| {{RootPage2|Arizona/To do}}
| {{RootPage2|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}}
| {{SubPage2|Arizona/Test/To do}}
|-
| Arizona/Test
| {{RootPage2|Arizona/Test}}
| {{BasePage2|Arizona/Test}}
| {{SubPage2|Arizona/Test}}
|-
|-
| 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}}
 
| {{SubPage2|Arizona/Test/To do/Main}}
A related version of this template is {{tl|BasePage2}} where it operates the same as {{tlc|RootPage2}} except it uses the basepage. 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.
|-
 
| District of Columbia/Test/To do/Main
{| class= "wikitable"
| {{RootPage2|District of Columbia/Test/To do/Main}}
! Pagename
| {{BasePage2|District of Columbia/Test/To do/Main}}
! <nowiki>{{BasePage2}}</nowiki>
| {{SubPage2|District of Columbia/Test/To do/Main}}
|-
|-
| USA/CommonState/Test
| Arizona/Test/To do/Main/Preload
| {{BasePage2|USA/CommonState/Test}}
| {{RootPage2|Arizona/Test/To do/Main/Preload}}
| {{BasePage2|Arizona/Test/To do/Main/Preload}}
| {{SubPage2|Arizona/Test/To do/Main/Preload}}
|-
|-
| USA/CommonState
| District of Columbia/Test/To do/Main/Preload
| {{BasePage2|USA/CommonState}}
| {{RootPage2|District of Columbia/Test/To do/Main/Preload}}
| {{BasePage2|District of Columbia/Test/To do/Main/Preload}}
| {{SubPage2|District of Columbia/Test/To do/Main/Preload}}
|-
|-
| Arizona/To do
| Arizona/To do/Main/Preload
| {{BasePage2|Arizona/To do}}
| {{RootPage2|Arizona/To do/Main/Preload}}
| {{BasePage2|Arizona/To do/Main/Preload}}
| {{SubPage2|Arizona/To do/Main/Preload}}
|-
|-
| Arizona/Test/To do
| Arizona/Testing/To do/Main/Preload
| {{BasePage2|Arizona/Test/To do}}
| {{RootPage2|Arizona/Testing/To do/Main/Preload}}
| {{BasePage2|Arizona/Testing/To do/Main/Preload}}
| {{SubPage2|Arizona/Testing/To do/Main/Preload}}
|-
|-
| Arizona/Test/To do/Main
| Arizona/Testing/To do/Preload
| {{BasePage2|Arizona/Test/To do/Main}}
| {{RootPage2|Arizona/Testing/To do/Preload}}
| {{BasePage2|Arizona/Testing/To do/Preload}}
| {{SubPage2|Arizona/Testing/To do/Preload}}
|}
|}
<includeonly>
<includeonly>
<!-- ADD CATEGORIES BELOW THIS LINE -->
<!-- ADD CATEGORIES BELOW THIS LINE -->
 
[[Category:Templates for or part of the state template]]
[[Category:Linking templates]]
<!-- ADD INTERWIKIS BELOW THIS LINE -->
<!-- ADD INTERWIKIS BELOW THIS LINE -->


</includeonly>
</includeonly>

Latest revision as of 00:45, 16 August 2022

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.

These templates uses the #titleparts parser function extension to extract only the root of the page name. This documentation covers 4 related templates.

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 {{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 or region name on pages and the template itself will display CommonState. It is like a template to obtain the state or territory name for other templates.
{{BasePage2}}
It operates half way between {{RootPage2}} and {{BASEPAGENAME}}. It is highly customized for the USA/CommonState template suite. The pages with "USA/CommonState" respond with USA/CommonState, but all other pages return the primary pagename of BasePageName or BasePageName/Test... (and exclude USA for regions). This enables the automation of USA/CommonState to display normally if it is deployed on test pages. The state or region 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. This function requires test pages only start from a subpage that begins /Test... below the initial page name for the state or territory. This also means no other section be created as a subpage that begins with /Test....
Page name Intent Condition
California/Test Main test page for a new California template Good
California/Test city
California/Testimonials
A custom section to link from other current pages Bad. This page will cause link failures if {{BasePage2}} is used on that page.
{{SubPage2}}
Like BasePage2 it is highly customized for the USA/CommonState template suite. On pages with USA/CommonState, it will display the primary/initial subpage (if present), which serves as the section page name, otherwise it is blank. For all other pages, it returns the first subpage after BasePage2.


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
USA/Southeast/Test/Test 2 Southeast USA/Southeast/Test Test 2
USA/Southeast/Test 2 Southeast USA/Southeast/Test 2
USA/Southeast/To do Southeast USA/Southeast To do
Arizona/To do Arizona Arizona To do
Arizona/Test/To do Arizona Arizona/Test To do
Arizona/Test Arizona Arizona/Test
Arizona/Test/To do/Main Arizona Arizona/Test To do
District of Columbia/Test/To do/Main District of Columbia District of Columbia/Test To do
Arizona/Test/To do/Main/Preload Arizona Arizona/Test To do
District of Columbia/Test/To do/Main/Preload District of Columbia District of Columbia/Test To do
Arizona/To do/Main/Preload Arizona Arizona To do
Arizona/Testing/To do/Main/Preload Arizona Arizona/Testing To do
Arizona/Testing/To do/Preload Arizona Arizona/Testing To do