Help:DefaultLinks

From Wowpedia
Jump to: navigation, search
HELP CONTENTS · Getting Started · New to Wowpedia · Editing Wowpedia · The Wowpedia Community · Additional Help
See http://meta.wikimedia.org/ Meta-Wiki HelpIntro for basic MediaWiki usage!

There exist a large number of articles describing World of Warcraft items, quests, and other in-game content for which we typically prefer to use formatted links to communicate some degree of information about the linked article. For instance, links to items typically show a colored link in square brackets (like [Warp Slicer]), emulating the way item links are displayed in game. The DefaultLinks extension allows pages to specify default incoming link formatting, which will be applied to normal [[Links]] to the page, allowing editors to use simple linking syntax in place of one of many formatting templates previously used to assist with this. This syntax works in-hand with these templates to generate the appropriate output - the templates themselves may still be used, though it is no longer required.

Syntax

A parser function specifies the default link format for the page it appears on (even if transcluded):

{{DEFAULTLINK:link wikitext|page title|options}} 
The second and third parameters are optional.
link wikitext 
Wiki-formatted default link text, which must contain a link back to the original page; the formatting text should, as far as possible, be plain wiki text (without use of parser tags).
page title 
If provided, the link formatting will only be used for the page with this title; otherwise, the formatting will be used on all pages this tag is on if the link wikitext contains a link back to the page in question.
options 
If this argument contains "silent", some warnings about invalid usage will not be output.

Currently, only pages in the main namespace are allowed to override default link formatting. If multiple DEFAULTLINK calls appear on one page but specify differing link formatting, a warning is output and the page is placed in Category:Pages with DEFAULTLINK conflicts.

Avoiding default formatting

The extension will only format caption-less links to pages in the main namespace; the links must also not begin with a colon. Thus, [[Link]] will be formatted, while [[Link|Link]], [[Link]]s, and [[:Link]] will not. Therefore, it is enough to simply provide a caption (i.e. [[Link|Link]]) if you wish to avoid applying default formatting to a link.

Default link formatting is suppressed inside <nodefaultlinks>...</nodefaultlinks> tags, making those a viable option for avoiding default formatting within, for example, a navbox.

Placing the __NODEFAULTLINKS__ magic word on a page suppresses default link formatting on the entire page.

Use on Wowpedia

On Wowpedia, the DEFAULTLINK parser function is typically used in templates providing other functionality. We currently use this extension to format links to several classes of pages:

Page type Default link format Applied by Equivalent templates
Item pages  [Shadowmourne] {{itemtip}} {{item}}, {{loot}}
Quests N [60G] In Dreams {{questbox}} {{questlong}}, {{questclass}}
Achievements [Stood in the Fire] {{achievementtip}} {{achievement}}
Enchants Enchant Weapon - Agility {{enchant}} {{loot}}
Abilities [Fireball] {{abilitytip}} {{ability}}
Currency [Mark of the World Tree] {{currencytip}} N/A
NPCs+... Anduin Wrynn {{npcbox}} N/A

Templates applying link formatting are categorized in Category:Templates modifying defaultlinks.