Difference between revisions of "Template:Sec link auto"

From Self-sufficiency
Jump to: navigation, search
(Creating this "automatic secure server link" template.)
m (1 revision: Digital circuits (Import from Wikipedia))
 
(16 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{#switch:   <!--Empty or undefined-->
+
{{#switch: {{lc: {{{padlock|}}} }}
| {{{1|}}}
+
   | yes    <!--Supress CSS icon, to not get double icon-->
| {{{2|}}} =
+
   | no = <span class="plainlinks">
   <!--No project or no pagename fed, show syntax-->
+
   }}[{{sec link/relative url
   <code><nowiki>{{sec link auto|project|pagename|text}}</nowiki></code>
+
  | project = {{{1|}}}
| #default =
+
  | pagename = {{{2|}}}
   {{#ifeq: {{SERVERNAME}} | secure.wikimedia.org
+
  | lang = {{{lang|}}}
  | [https://secure.wikimedia.org/{{#switch: {{lc: {{{1|}}} }}
+
  | query = {{{query|}}}
    | wikipedia | w = wikipedia/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
  | anchor = {{{anchor|}}}
    | wiktionary | wikt = wiktionary/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
  }} {{sec link/text
    | wikinews | n = wikinews/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
  | project = {{{1|}}}
    | wikibooks | b = wikibooks/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
  | pagename = {{{2|}}}
    | wikiquote | q = wikiquote/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
  | text = {{{3|}}}
    | wikisource | s = wikipedia/sources
+
  | lang = {{{lang|}}}
    | wikispecies | species = wikipedia/species
+
  | query = {{{query|}}}
    | wikiversity | v = wikiversity/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
   | anchor = {{{anchor|}}}
    | wikimedia | foundation | wmf = wikipedia/foundation
+
  }}]{{#switch: {{lc: {{{padlock|}}} }}
    | commons = wikipedia/commons
+
  | no = </span>
    | meta | metawikipedia | m = wikipedia/meta
+
  | yes = </span>[[File:Lock icon blue.gif|16x13px|link=]]
    | 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/{{#if:x| {{{2|}}} }} {{#if:{{{3|}}}
+
    | {{{3}}}
+
    | {{#if:{{{1|}}}|{{{1}}}|{{CONTENTLANG}}}}:{{#if:{{{lang|}}}
+
      | {{#if:x| {{{lang}}} }}:
+
      }}{{#if:x| {{{2|}}} }}
+
    }}]
+
 
+
   | <!--Not on the secure server, make a normal link-->
+
    [[:{{#if:{{{1|}}}|{{{1}}}|{{CONTENTLANG}}}}:{{#if:{{{lang|}}}
+
    | {{#if:x| {{{lang}}} }}:
+
    }}{{#if:x| {{{2|}}} }}|{{#if:{{{3|}}}
+
    | {{{3}}}
+
    | {{#if:{{{1|}}}|{{{1}}}|{{CONTENTLANG}}}}:{{#if:{{{lang|}}}
+
      | {{#if:x| {{{lang}}} }}:
+
      }}{{#if:x| {{{2|}}} }}
+
    }}]]
+
  }}
+
 
}}<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