Difference between revisions of "Template:Sec link auto"

From Self-sufficiency
Jump to: navigation, search
(Renaming parameter "image=yes/no" to "padlock=yes/no" since that is clearer.)
m (1 revision: Digital circuits (Import from Wikipedia))
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{#ifeq: {{SERVERNAME}} | secure.wikimedia.org
+
{{#switch: {{lc: {{{padlock|}}} }}
| {{#switch: {{lc: {{{padlock|}}} }}
+
 
   | yes    <!--Supress CSS icon, to not 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|}}} }}
+
   }}[{{sec link/relative url
   | wikipedia | w = wikipedia/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
   | project = {{{1|}}}
   | wiktionary | wikt = wiktionary/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
   | pagename = {{{2|}}}
   | wikinews | n = wikinews/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
   | lang = {{{lang|}}}
   | wikibooks | b = wikibooks/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
   | query = {{{query|}}}
   | wikiquote | q = wikiquote/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
   | anchor = {{{anchor|}}}
   | wikisource | s = wikisource/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
   }} {{sec link/text
  | oldwikisource = wikipedia/sources
+
   | project = {{{1|}}}
   | wikispecies | species = wikipedia/species
+
   | pagename = {{{2|}}}
  | wikiversity | v = wikiversity/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
   | text = {{{3|}}}
   | wikimedia | foundation | wmf = wikipedia/foundation
+
   | lang = {{{lang|}}}
  | commons = wikipedia/commons
+
  | query = {{{query|}}}
  | meta | metawikipedia | m = wikipedia/meta
+
  | anchor = {{{anchor|}}}
  | strategy = wikipedia/strategy
+
  | incubator = wikipedia/incubator
+
  | mw = wikipedia/mediawiki
+
  | nost = wikipedia/nostalgia
+
  | testwiki = wikipedia/test
+
  | #default = wikipedia/{{#if:{{{1|}}}|{{{1}}}|{{CONTENTLANG}}}}    <!-- Other language edition -->
+
  }}/wiki/{{PAGENAMEE:Template:{{{2|}}} }}{{#if:{{{query|}}}
+
   | ?{{{query|}}}
+
  | {{#if:{{{anchor|}}}
+
    | &#35;{{anchorencode:{{{anchor}}} }}
+
    }}
+
  }} {{#if: {{{3|}}}
+
   | {{{3}}}
+
  | {{#if: {{{1|}}} | {{{1}}} | {{CONTENTLANG}} }}:{{#if: {{{lang|}}}
+
    | {{{lang}}}:
+
    }}{{#if:x| {{{2|}}} }}{{#if:{{{query|}}}
+
    | ?{{{query|}}}
+
    | {{#if:{{{anchor|}}}
+
      | &#35;{{{anchor}}}
+
      }}
+
    }}
+
 
   }}]{{#switch: {{lc: {{{padlock|}}} }}
 
   }}]{{#switch: {{lc: {{{padlock|}}} }}
 
   | no = </span>
 
   | no = </span>
 
   | yes = </span>[[File:Lock icon blue.gif|16x13px|link=]]
 
   | yes = </span>[[File:Lock icon blue.gif|16x13px|link=]]
  }}
 
 
| <!--Not on the secure server, make a normal link-->
 
  {{#if:{{{query|}}}
 
  | <!--Make a query link-->
 
    <span class="plainlinks">[{{fullurl: {{#if:{{{1|}}}|{{{1}}}|{{CONTENTLANG}}}}:{{#if: {{{lang|}}}
 
      | {{{lang}}}:
 
      }}{{#if:x| {{{2|}}} }}
 
    }}?{{{query|}}} {{#if: {{{3|}}}
 
    | {{{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>
  
{{pp-template}}
 
 
{{documentation}}
 
{{documentation}}
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
</noinclude>
 
</noinclude>

Latest revision as of 18:11, 9 December 2011

Main Page