Difference between revisions of "Template:When on basepage"

From annadreambrush.com/wiki
Jump to navigation Jump to search
imported>Davidgothberg
(Adding {{pp-template}} and a code comment.)
imported>Davidgothberg
(Changing to use parameter "page" instead of "demospace", since more flexible so we can make all the page name detecting templates compatible.)
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-->
Line 12: Line 18:
 
     }}
 
     }}
 
   }}
 
   }}
| basepage = {{{1|}}}
+
 
| subpage = {{{2|}}}
+
| basepage   = {{{1|}}}
 +
| subpage   = {{{2|}}}
 
| subsubpage = {{{3| {{{2|}}} }}}  <!--Respecting empty parameter on purpose-->
 
| subsubpage = {{{3| {{{2|}}} }}}  <!--Respecting empty parameter on purpose-->
| #default =  <!--Faulty demospace parameter, do nothing-->
 
 
}}<!--End switch--><noinclude>
 
}}<!--End switch--><noinclude>
  

Revision as of 12:30, 4 November 2009

Template documentation[create]