Difference between revisions of "Template:Superlink"
From Twinsuniverse
J McKalling (Talk | contribs) m |
J McKalling (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | <includeonly></includeonly><noinclude> | + | <includeonly> {{ |
+ | #ifeq: {{{hide|false}}} | false | ||
+ | | <sup>[{{ | ||
+ | #if: {{{article|}}}{{{label|}}} | ||
+ | |{{ | ||
+ | #if: {{{article|}}} | ||
+ | |{{ | ||
+ | #if: {{{label|}}} | ||
+ | | [[{{{article}}}|{{{label}}}]] | ||
+ | | [[{{{article}}}]] }} | ||
+ | |''{{{label}}}''}} | ||
+ | |'''''broken superlink'''''}}]</sup> | ||
+ | }}</includeonly><noinclude> | ||
This template is used to create a link between superscript rectangle brackets, like: <sup>[[[Main Page|this]]]</sup>. | This template is used to create a link between superscript rectangle brackets, like: <sup>[[[Main Page|this]]]</sup>. | ||
==Parameters== | ==Parameters== | ||
+ | * '''article''': the article page or category page to link to | ||
+ | * '''label''': the text to display on the link | ||
+ | * '''hide''': the result of the condition whether to hide the superlink | ||
==Syntax== | ==Syntax== | ||
+ | <nowiki>{{superlink | ||
+ | |article = | ||
+ | |label = | ||
+ | |hide = | ||
+ | }}</nowiki> | ||
==Examples== | ==Examples== | ||
+ | Common use of the superlink include both '''article''' and '''label''' parameters: | ||
+ | <nowiki>some text here{{superlink|article = Main Page|label = some link}}</nowiki> | ||
+ | |||
+ | {| border="0" cellspacing="0" cellpadding="3" style="border: solid 1px #ababab;" | ||
+ | |- | ||
+ | | some text here <sup>[[[Main Page|some link]]]</sup> | ||
+ | |} | ||
+ | |||
+ | If the '''article''' parameter is not used, the superlink will render as ''italic'' text using only the '''label''' parameter: | ||
+ | <nowiki>some text here{{superlink|label = notice}}</nowiki> | ||
+ | |||
+ | {| border="0" cellspacing="0" cellpadding="3" style="border: solid 1px #ababab;" | ||
+ | |- | ||
+ | | some text here <sup>[''notice'']</sup> | ||
+ | |} | ||
+ | |||
+ | If the '''label''' parameter is not used, the superlink will render the link to the '''article''' without any custom text: | ||
+ | <nowiki>some text here{{superlink|article = Main Page}}</nowiki> | ||
+ | |||
+ | {| border="0" cellspacing="0" cellpadding="3" style="border: solid 1px #ababab;" | ||
+ | |- | ||
+ | | some text here <sup>[[[Main Page]]]</sup> | ||
+ | |} | ||
+ | |||
+ | If no parameters are used, the superlink will render error text like this: | ||
+ | <nowiki>some text here{{superlink}}</nowiki> | ||
+ | |||
+ | {| border="0" cellspacing="0" cellpadding="3" style="border: solid 1px #ababab;" | ||
+ | |- | ||
+ | | some text here <sup>['''''broken superlink''''']</sup> | ||
+ | |} | ||
+ | |||
+ | If the '''hide''' parameter is used (any non-empty value will do), the superlink will be hidden altogether: | ||
+ | <nowiki>some text here{{superlink|article = Main Page|label = some link|hide=true}}</nowiki> | ||
+ | |||
+ | {| border="0" cellspacing="0" cellpadding="3" style="border: solid 1px #ababab;" | ||
+ | |- | ||
+ | | some text here | ||
+ | |} | ||
[[Category:Twinsuniverse - Templates]] | [[Category:Twinsuniverse - Templates]] | ||
</noinclude> | </noinclude> |
Revision as of 17:36, 11 November 2012
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
- hide: the result of the condition whether to hide the superlink
Syntax
{{superlink |article = |label = |hide = }}
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 |