Difference between revisions of "Template:Sec link auto"

From Self-sufficiency
Jump to: navigation, search
(If MediaWiki has permission to unlink the padlock, then it is probably okay to do it here too.)
(Adding the "anchor" and "query" parameters.)
Line 1: Line 1:
 
{{#ifeq: {{SERVERNAME}} | secure.wikimedia.org
 
{{#ifeq: {{SERVERNAME}} | secure.wikimedia.org
 
| {{#switch: {{lc: {{{image|}}} }}
 
| {{#switch: {{lc: {{{image|}}} }}
   | yes    <!--Supress CSS icon, to no get double icon-->
+
   | yes    <!--Supress CSS icon, to not get double icon-->
 
   | no = <span class="plainlinks">
 
   | no = <span class="plainlinks">
 
   }}[https://secure.wikimedia.org/{{#switch: {{lc: {{{1|}}} }}
 
   }}[https://secure.wikimedia.org/{{#switch: {{lc: {{{1|}}} }}
Line 21: Line 21:
 
   | testwiki = wikipedia/test
 
   | testwiki = wikipedia/test
 
   | #default = wikipedia/{{#if:{{{1|}}}|{{{1}}}|{{CONTENTLANG}}}}    <!-- Other language edition -->
 
   | #default = wikipedia/{{#if:{{{1|}}}|{{{1}}}|{{CONTENTLANG}}}}    <!-- Other language edition -->
   }}/wiki/{{PAGENAMEE:Template:{{{2|}}} }} {{#if: {{{3|}}}
+
   }}/wiki/{{PAGENAMEE:Template:{{{2|}}} }}{{#if:{{{query|}}}
 +
  | ?{{{query|}}}
 +
  | {{#if:{{{anchor|}}}
 +
    | &#35;{{anchorencode:{{{anchor}}} }}
 +
    }}
 +
  }} {{#if: {{{3|}}}
 
   | {{{3}}}
 
   | {{{3}}}
 
   | {{#if: {{{1|}}} | {{{1}}} | {{CONTENTLANG}} }}:{{#if: {{{lang|}}}
 
   | {{#if: {{{1|}}} | {{{1}}} | {{CONTENTLANG}} }}:{{#if: {{{lang|}}}
     | {{#if:x| {{{lang}}} }}:
+
     | {{{lang}}}:
     }}{{#if:x| {{{2|}}} }}
+
    }}{{#if:x| {{{2|}}} }}{{#if:{{{query|}}}
 +
     | ?{{{query|}}}
 +
    | {{#if:{{{anchor|}}}
 +
      | &#35;{{{anchor}}}
 +
      }}
 +
    }}
 
   }}]{{#switch: {{lc: {{{image|}}} }}
 
   }}]{{#switch: {{lc: {{{image|}}} }}
 
   | no = </span>
 
   | no = </span>
Line 32: Line 42:
  
 
| <!--Not on the secure server, make a normal link-->
 
| <!--Not on the secure server, make a normal link-->
   [[:{{#if:{{{1|}}}|{{{1}}}|{{CONTENTLANG}}}}:{{#if:{{{lang|}}}
+
   {{#if:{{{query|}}}
  | {{#if:x| {{{lang}}} }}:
+
  | <!--Make a query link-->
  }}{{#if:x| {{{2|}}} }}|{{#if:{{{3|}}}
+
    <span class="plainlinks">[{{fullurl: {{#if:{{{1|}}}|{{{1}}}|{{CONTENTLANG}}}}:{{#if: {{{lang|}}}
  | {{{3}}}
+
      | {{{lang}}}:
   | {{#if:{{{1|}}}|{{{1}}}|{{CONTENTLANG}}}}:{{#if:{{{lang|}}}
+
      }}{{#if:x| {{{2|}}} }}
     | {{#if:x| {{{lang}}} }}:
+
    }}?{{{query|}}} {{#if: {{{3|}}}
     }}{{#if:x| {{{2|}}} }}
+
    | {{{3}}}
  }}]]
+
    | {{#if:{{{1|}}}|{{{1}}}|{{CONTENTLANG}}}}:{{#if: {{{lang|}}}
 +
      | {{{lang}}}:
 +
      }}{{#if:x| {{{2|}}} }}?{{{query|}}}
 +
    }}]</span>
 +
   | <!--Make a normal link-->
 +
    [[:{{#if:{{{1|}}}|{{{1}}}|{{CONTENTLANG}}}}:{{#if: {{{lang|}}}
 +
     | {{{lang}}}:
 +
    }}{{#if:x| {{{2|}}} }}{{#if:{{{anchor|}}}
 +
     | &#35;{{{anchor}}}
 +
    }}|{{#if: {{{3|}}}
 +
    | {{{3}}}
 +
    | {{#if:{{{1|}}}|{{{1}}}|{{CONTENTLANG}}}}:{{#if: {{{lang|}}}
 +
      | {{{lang}}}:
 +
      }}{{#if:x| {{{2|}}} }}{{#if:{{{anchor|}}}
 +
      | &#35;{{{anchor}}}
 +
      }}
 +
    }}]]
 +
  }}
 
}}<noinclude>
 
}}<noinclude>
  

Revision as of 12:58, 4 December 2009

en: