Template:BasePage2 View history

(test)
(improved and simplified)
Line 1: Line 1:
{{#ifeq: {{#titleparts:{{{1|{{PAGENAME}}}}}|1|1}}| USA<!-- If USA template page -->
{{#ifeq: {{#titleparts:{{{1|{{PAGENAME}}}}}|1|1}}| USA<!-- If USA template page -->
   | {{#titleparts:{{{1|{{PAGENAME}}}}}|1|2}}<!-- Return "USA/CommonState"-->
   | {{#titleparts:{{{1|{{PAGENAME}}}}}|2}}<!-- Return "USA/xxxxx"-->
   | {{#ifeq: {{#titleparts:{{{1|{{PAGENAME}}}}}||-1}}|Main<!-- If ending "Main" -->
   | {{#ifeq: {{padright:|4|{{#titleparts:{{{1|{{PAGENAME}}}}}|1|2}}}}|Test<!-- If 2nd level = "Test..." -->
      | {{#titleparts:{{{1|{{PAGENAME}}}}}|-2}}<!-- Return all but "Main" -->
      | {{#titleparts:{{{1|{{PAGENAME}}}}}|2}}<!-- Return first two levels -->
      | {{#ifeq: {{#titleparts:{{{1|{{PAGENAME}}}}}|-1|-2}}|Main<!-- If ending "Main/Preload"-->
      | {{#titleparts:{{{1|{{PAGENAME}}}}}|1}}<!-- Else return 1st level only -->
          | {{#titleparts:{{{1|{{PAGENAME}}}}}|-3}}<!-- Return all but "Main/Preload"-->
     }}
          | {{#titleparts:{{{1|{{PAGENAME}}}}}|-1}}<!-- Testing if works normally -->
<!--     | {{{1|{{PAGENAME}}}}}-->
        }}
    }}
}}<noinclude>{{documentation|Template:RootPage/doc}}</noinclude>
}}<noinclude>{{documentation|Template:RootPage/doc}}</noinclude>

Revision as of 22:27, 18 July 2014

BasePage2

Documentation icon Template documentation[create]
Subpages of this template.