Template:Namespace detect showall: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Davidgothberg
(Copying this code from my test page in my user space.)
 
m (1 revision imported)
 
(12 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{#switch:    <!-- Use the parameter -->
{{safesubst<noinclude />:#switch:    <noinclude><!-- Use the parameter --></noinclude>
   {{#switch:    <!-- Find out which parameter to use -->
   {{safesubst<noinclude />:#switch:    <noinclude><!-- Find out which parameter to use --></noinclude>
     {{lc:    <!--Lower case the result-->
     {{lc:    <noinclude><!--Lower case the result--></noinclude>
       <!--If no or empty "demospace" parameter then detect namespace-->
       <noinclude><!--If no or empty "demospace" parameter then detect namespace--></noinclude>
       {{#if:{{{demospace|}}}  
       {{safesubst<noinclude />:#if:{{{demospace|}}}
       | {{{demospace}}}
       | {{{demospace}}}
       | {{#ifeq:{{NAMESPACE}}|{{ns:0}}
       | {{safesubst<noinclude />:#if:{{{page|}}}
         | main
         | <noinclude><!--Detect the namespace in the "page" parameter--></noinclude>
        | {{#ifeq:{{NAMESPACE}}|{{TALKSPACE}}
          {{safesubst<noinclude />:#ifeq:{{NAMESPACE:{{{page}}} }}|{{TALKSPACE:{{{page}}} }}
           | talk
           | talk
           | {{NAMESPACE}}  
           | {{SUBJECTSPACE:{{{page}}} }}
           }}
           }}
         }}  
        | <noinclude><!--No "demospace" or "page" parameters, so detect actual namespace--></noinclude>
          {{safesubst<noinclude />:#ifeq:{{NAMESPACE}}|{{TALKSPACE}}
          | talk
          | {{SUBJECTSPACE}}
          }}
         }}
       }}
       }}
     }}
     }}
   <!-- Only one of the lines below will be executed -->
   <noinclude><!-- Only one of the lines below will be executed --></noinclude>
   <!-- Respecting empty parameters on purpose -->
   <noinclude><!-- Respecting empty parameters on purpose --></noinclude>
   | showall  = showall  <!-- "demospace=showall" -->
   | showall  = showall  <noinclude><!-- "demospace=showall" --></noinclude>
   | main     = {{{main| {{{other|}}} }}}
   | main         <noinclude><!--"demospace=main" or {{SUBJECTSPACE}}={{ns:0}}=""--></noinclude>
  |          = {{{main| {{{other|}}} }}}
   | talk      = {{{talk| {{{other|}}} }}}
   | talk      = {{{talk| {{{other|}}} }}}
   | user      = {{{user| {{{other|}}} }}}
   | user      = {{{user| {{{other|}}} }}}
   | wikipedia = {{{wikipedia| {{{other|}}} }}}
   | wikipedia = {{{wikipedia| {{{other|}}} }}}
   | image    = {{{image| {{{other|}}} }}}
  | file
   | image    = {{{file| {{{image| {{{other|}}} }}} }}}
   | mediawiki = {{{mediawiki| {{{other|}}} }}}
   | mediawiki = {{{mediawiki| {{{other|}}} }}}
   | template  = {{{template| {{{other|}}} }}}
   | template  = {{{template| {{{other|}}} }}}
Line 27: Line 34:
   | category  = {{{category| {{{other|}}} }}}
   | category  = {{{category| {{{other|}}} }}}
   | portal    = {{{portal| {{{other|}}} }}}
   | portal    = {{{portal| {{{other|}}} }}}
  | draft    = {{{draft| {{{other|}}} }}}
   | other
   | other
   | #default  = {{{other|}}} <!--"demospace=other" or a new namespace-->
   | #default  = {{{other|}}} <noinclude><!--"demospace=other" or a new namespace--></noinclude>
   }}
   }}


Line 37: Line 45:
| 5 = {{{5|}}}
| 5 = {{{5|}}}
| 6 = {{{6|}}}
| 6 = {{{6|}}}
| showall = {{{1|}}}{{{2|}}}{{{3|}}}{{{4|}}}{{{5|}}}{{{6|}}}
| 7 = {{{7|}}}
| 8 = {{{8|}}}
| 9 = {{{9|}}}
| 10 = {{{10|}}}
| 11 = {{{11|}}}
| 12 = {{{12|}}}
| 13 = {{{13|}}}
 
| showall = {{{1|}}}{{{2|}}}{{{3|}}}{{{4|}}}{{{5|}}}{{{6|}}}{{{7|}}}{{{8|}}}{{{9|}}}{{{10|}}}{{{11|}}}{{{12|}}}{{{13|}}}
}}<noinclude>
}}<noinclude>



Latest revision as of 17:46, 30 November 2023