Difference between revisions of "Template:Superlink"

From Twinsuniverse
Jump to: navigation, search
m (Examples)
(added infobox)
 
(3 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
         #if: {{{article|}}}
 
         #if: {{{article|}}}
 
         |{{
 
         |{{
             #if: {{{label|}}}
+
             #ifeq: {{{external|false}}} | false
            | [[{{{article}}}|{{{label}}}]]
+
            |{{
            | [[{{{article}}}]] }}
+
                #if: {{{label|}}}
 +
                | [[{{{article}}}|{{{label}}}]]
 +
                | [[{{{article}}}]] }}
 +
            |{{
 +
                #if: {{{label|}}}
 +
                | [//{{{article}}} {{{label}}}]
 +
                | [//{{{article}}}] }}}}
 
         |''{{{label}}}''}}
 
         |''{{{label}}}''}}
 
     |'''''broken superlink'''''}}&#93;</sup>
 
     |'''''broken superlink'''''}}&#93;</sup>
}}</includeonly><noinclude>
+
}}</includeonly><noinclude>{{Infobox Template
 +
|purpose=formatting
 +
|singletag=no
 +
|multiline=no
 +
|gamerelated=no
 +
|suppressible=
 +
|choice=
 +
|cat1=
 +
|var1=
 +
}}
 +
 
 
This template is used to create a link between superscript rectangle brackets, like: <sup>&#91;[[Main Page|this]]&#93;</sup>.
 
This template is used to create a link between superscript rectangle brackets, like: <sup>&#91;[[Main Page|this]]&#93;</sup>.
  
Line 17: Line 33:
 
* '''article''': the article page or category page to link to
 
* '''article''': the article page or category page to link to
 
* '''label''': the text to display on the link
 
* '''label''': the text to display on the link
 +
* '''external''': whether or not to make the link function as an external link (defaults to false)
 
* '''hide''': the result of the condition whether to hide the superlink
 
* '''hide''': the result of the condition whether to hide the superlink
  
Line 24: Line 41:
 
  |label =  
 
  |label =  
 
  |hide =  
 
  |hide =  
 +
|external=
 
}}</nowiki>
 
}}</nowiki>
  
Line 31: Line 49:
  
 
:some text here <sup>&#91;[[Main Page|some link]]&#93;</sup>
 
:some text here <sup>&#91;[[Main Page|some link]]&#93;</sup>
 +
  
 
If the '''article''' parameter is not used, the superlink will render as ''italic'' text using only the '''label''' parameter:
 
If the '''article''' parameter is not used, the superlink will render as ''italic'' text using only the '''label''' parameter:
Line 36: Line 55:
  
 
:some text here <sup>&#91;''notice''&#93;</sup>
 
:some text here <sup>&#91;''notice''&#93;</sup>
 +
  
 
If the '''label''' parameter is not used, the superlink will render the link to the '''article''' without any custom text:
 
If the '''label''' parameter is not used, the superlink will render the link to the '''article''' without any custom text:
Line 41: Line 61:
  
 
:some text here <sup>&#91;[[Main Page]]&#93;</sup>
 
:some text here <sup>&#91;[[Main Page]]&#93;</sup>
 +
  
 
If no parameters are used, the superlink will render error text like this:
 
If no parameters are used, the superlink will render error text like this:
Line 46: Line 67:
  
 
:some text here <sup>&#91;'''''broken superlink'''''&#93;</sup>
 
:some text here <sup>&#91;'''''broken superlink'''''&#93;</sup>
 +
  
 
If the '''hide''' parameter is used (any non-empty value will do), the superlink will be hidden altogether:
 
If the '''hide''' parameter is used (any non-empty value will do), the superlink will be hidden altogether:
Line 53: Line 75:
 
This could be useful somewhere on a page where a condition would determine whether you want to display a particular superlink there.
 
This could be useful somewhere on a page where a condition would determine whether you want to display a particular superlink there.
  
[[Category:Twinsuniverse - Templates]]
+
 
 +
If the '''external''' parameter is used (any non-empty value will do), the superlink will be an external link:
 +
<nowiki>some text here{{superlink|article=www.google.com|label=Google search|external=true}}</nowiki>
 +
 
 +
:some text here <sup>&#91;[//www.google.com Google search]&#93;</sup>
 +
 
 
</noinclude>
 
</noinclude>

Latest revision as of 10:50, 4 June 2014

Superlink
Purpose

Formatting [list all]

Single tag

No [list all]

Multi-line

No [list all]

Protected

No [list all]

Game related

No [list all]

Categorization
Categories

none [list all]

Variables
Names

none [list all]

Subpages

This template is used to create a link between superscript rectangle brackets, like: [this].

Parameters

  • article: the article page or category page to link to
  • label: the text to display on the link
  • external: whether or not to make the link function as an external link (defaults to false)
  • hide: the result of the condition whether to hide the superlink

Syntax

{{superlink
 |article = 
 |label = 
 |hide = 
 |external=
}}

Examples

Common use of the superlink include both article and label parameters:

some text here{{superlink|article = Main Page|label = some link}}
some text here [some link]


If the article parameter is not used, the superlink will render as italic text using only the label parameter:

some text here{{superlink|label = notice}}
some text here [notice]


If the label parameter is not used, the superlink will render the link to the article without any custom text:

some text here{{superlink|article = Main Page}}
some text here [Main Page]


If no parameters are used, the superlink will render error text like this:

some text here{{superlink}}
some text here [broken superlink]


If the hide parameter is used (any non-empty value will do), the superlink will be hidden altogether:

some text here{{superlink|article = Main Page|label = some link|hide=true}}
some text here

This could be useful somewhere on a page where a condition would determine whether you want to display a particular superlink there.


If the external parameter is used (any non-empty value will do), the superlink will be an external link:

some text here{{superlink|article=www.google.com|label=Google search|external=true}}
some text here [Google search]