Template:Format link/doc: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Codename Lisa
m (Codename Lisa moved page Template:Format hatnote link/doc to Template:Format link/doc: Parnet page moved)
meta>Codename Lisa
(Added cat. and see also section)
Line 9: Line 9:
; Link only
; Link only


  {{format hatnote link|''link''}}
  {{format link|''link''}}


; Link plus display
; Link plus display


  {{format hatnote link|''link''|''display''}}
  {{format link|''link''|''display''}}


If the link or display values contain an equals sign, you will need to specify the parameter names like this:
If the link or display values contain an equals sign, you will need to specify the parameter names like this:


  {{format hatnote link|1=''link''|2=''display''}}
  {{format link|1=''link''|2=''display''}}


== Examples ==
== Examples ==


* <code><nowiki>{{format hatnote link|Lion}}</nowiki></code> &rarr; <nowiki>[[Lion]]</nowiki> &rarr; {{format hatnote link|Lion}}
* <code><nowiki>{{format link|Lion}}</nowiki></code> &rarr; <nowiki>[[Lion]]</nowiki> &rarr; {{format link|Lion}}
* <code><nowiki>{{format hatnote link|Lion#Etymology}}</nowiki></code> &rarr; <nowiki>[[Lion#Etymology|Lion § Etymology]]</nowiki> &rarr; {{format hatnote link|Lion#Etymology}}
* <code><nowiki>{{format link|Lion#Etymology}}</nowiki></code> &rarr; <nowiki>[[Lion#Etymology|Lion § Etymology]]</nowiki> &rarr; {{format link|Lion#Etymology}}
* <code><nowiki>{{format hatnote link|Category:Lions}}</nowiki></code> &rarr; <nowiki>[[:Category:Lions]]</nowiki> &rarr; {{format hatnote link|Category:Lions}}
* <code><nowiki>{{format link|Category:Lions}}</nowiki></code> &rarr; <nowiki>[[:Category:Lions]]</nowiki> &rarr; {{format link|Category:Lions}}
* <code><nowiki>{{format hatnote link|Lion#Etymology|Etymology of lion}}</nowiki></code> &rarr; <nowiki>[[Lion#Etymology|Etymology of lion]]</nowiki> &rarr; {{format hatnote link|Lion#Etymology|Etymology of lion}}
* <code><nowiki>{{format link|Lion#Etymology|Etymology of lion}}</nowiki></code> &rarr; <nowiki>[[Lion#Etymology|Etymology of lion]]</nowiki> &rarr; {{format link|Lion#Etymology|Etymology of lion}}
* <code><nowiki>{{format hatnote link}}</nowiki></code> &rarr; {{format hatnote link|category=no}}
* <code><nowiki>{{format link}}</nowiki></code> &rarr; {{format link|category=no}}
 
== See also ==
* {{tl|Section link}}


<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
<!-- Categories go here and interwikis go in Wikidata. -->
<!-- Categories go here and interwikis go in Wikidata. -->
 
[[Category:Internal link templates]]
}}</includeonly>
}}</includeonly>

Revision as of 06:38, 22 May 2014

This template formats a link for use in hatnote templates. It accepts two positional parameters, the link, and an optional display value. Links to categories and files are automatically escaped with the colon trick, and links to sections are automatically formatted as page § section, rather than the MediaWiki default of page#section.

Usage

Link only
{{format link|link}}
Link plus display
{{format link|link|display}}

If the link or display values contain an equals sign, you will need to specify the parameter names like this:

{{format link|1=link|2=display}}

Examples

  • {{format link|Lion}} → [[Lion]] → Script error: The function "formatLink" does not exist.
  • {{format link|Lion#Etymology}} → [[Lion#Etymology|Lion § Etymology]] → Script error: The function "formatLink" does not exist.
  • {{format link|Category:Lions}} → [[:Category:Lions]] → Script error: The function "formatLink" does not exist.
  • {{format link|Lion#Etymology|Etymology of lion}} → [[Lion#Etymology|Etymology of lion]] → Script error: The function "formatLink" does not exist.
  • {{format link}}Script error: The function "formatLink" does not exist.

See also