Difference between revisions of "Template:When on basepage"

From annadreambrush.com/wiki
Jump to navigation Jump to search
imported>Davidgothberg
(Creating this basepage/subpage/subsubpage detecting template.)
 
imported>Sardanaphalus
m (Sardanaphalus moved page Template:Basepage subpage to Template:When on basepage: Per move request)
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{#switch:
 
{{#switch:
   <!--If no or empty "demospace" parameter then detect
+
   <!--If no or empty "page" parameter then detect
 
       basepage/subpage/subsubpage-->
 
       basepage/subpage/subsubpage-->
   {{#if:{{{demospace|}}}
+
   {{#if:{{{page|}}}
   | {{lc: {{{demospace}}} }}    <!--Use lower case "demospace"-->
+
   | {{#if:{{#titleparts:{{{page}}}|0|3}}
 +
    | subsubpage   <!--Subsubpage or lower-->
 +
    | {{#if:{{#titleparts:{{{page}}}|0|2}}
 +
      | subpage
 +
      | basepage
 +
      }}
 +
    }}
 
   | {{#if:{{#titleparts:{{FULLPAGENAME}}|0|3}}
 
   | {{#if:{{#titleparts:{{FULLPAGENAME}}|0|3}}
     | subsubpage    <!-- Subsubpage or lower. -->
+
     | subsubpage    <!--Subsubpage or lower-->
 
     | {{#if:{{#titleparts:{{FULLPAGENAME}}|0|2}}
 
     | {{#if:{{#titleparts:{{FULLPAGENAME}}|0|2}}
 
       | subpage
 
       | subpage
Line 12: Line 18:
 
     }}
 
     }}
 
   }}
 
   }}
| basepage = {{{1|}}}
+
 
| subpage = {{{2|}}}
+
| basepage   = {{{1|}}}
| subsubpage = {{{3| {{{2|}}} }}}
+
| subpage   = {{{2|}}}
| #default =   <!-- Faulty demospace parameter, do nothing. -->
+
| subsubpage = {{{3| {{{2|}}} }}}  <!--Respecting empty parameter on purpose-->
 
}}<!--End switch--><noinclude>
 
}}<!--End switch--><noinclude>
 
+
{{Documentation}}
<!-- {{pp-template}} -->
 
{{documentation}}
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
 
</noinclude>
 
</noinclude>

Latest revision as of 09:52, 30 September 2014

Template documentation[create]