Difference between revisions of "Template:Sec link auto"

From Self-sufficiency
Jump to: navigation, search
(Adding a home cooked URL encode that actually works for Wikimedia links.)
m (1 revision: Digital circuits (Import from Wikipedia))
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{#ifeq: {{SERVERNAME}} | secure.wikimedia.org
+
{{#switch: {{lc: {{{padlock|}}} }}
| [https://secure.wikimedia.org/{{#switch: {{lc: {{{1|}}} }}
+
   | yes    <!--Supress CSS icon, to not get double icon-->
   | wikipedia | w = wikipedia/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
  | no = <span class="plainlinks">
   | wiktionary | wikt = wiktionary/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
  }}[{{sec link/relative url
   | 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}}}}
+
   | lang = {{{lang|}}}
   | wikisource | s = wikipedia/sources
+
   | query = {{{query|}}}
  | wikispecies | species = wikipedia/species
+
   | anchor = {{{anchor|}}}
  | wikiversity | v = wikiversity/{{#if:{{{lang|}}}|{{{lang}}}|{{CONTENTLANG}}}}
+
  }} {{sec link/text
  | wikimedia | foundation | wmf = wikipedia/foundation
+
   | project = {{{1|}}}
   | commons = wikipedia/commons
+
   | pagename = {{{2|}}}
  | meta | metawikipedia | m = wikipedia/meta
+
   | text = {{{3|}}}
  | strategy = wikipedia/strategy
+
   | lang = {{{lang|}}}
  | incubator = wikipedia/incubator
+
   | query = {{{query|}}}
  | mw = wikipedia/mediawiki
+
   | anchor = {{{anchor|}}}
  | nost = wikipedia/nostalgia
+
   }}]{{#switch: {{lc: {{{padlock|}}} }}
  | testwiki = wikipedia/test
+
   | no = </span>
  | #default = wikipedia/{{#if:{{{1|}}}|{{{1}}}|{{CONTENTLANG}}}}    <!-- Other language edition -->
+
  | yes = </span>[[File:Lock icon blue.gif|16x13px|link=]]
   }}/wiki/{{PAGENAMEE:Template:{{{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