Template:Link to category: Difference between revisions

From FrathWiki
Jump to navigationJump to search
(What's going on?)
 
m (cat)
 
Line 21: Line 21:
{{link to category|Diachronic conlangs}}
{{link to category|Diachronic conlangs}}


[[Category:Templates]]
</noinclude>
</noinclude>

Latest revision as of 01:14, 5 October 2014

[[:Category:{{{1}}}]]

The problem

If you try to make an ordinary wikilink to a category page with [[Category:CATEGORY NAME]]

you get the current page included in that category rather than a link to the category page.

The solution

Nevertheless you can make a wikilink to a category page with a bit of extra syntax: just put a colon between [[

and Category

, like this: [[:Category:CATEGORY NAME]] .

The template

This syntax is however somewhat obscure: it is easy to forget that extra colon, and a later editor unaware of this tiny bit of extra syntax might remove the colon. For these reasons it's probably more robust to have a template for this purpose.

Usage

   {{link to category|CATEGORY NAME}}

A bit more to type than the raw syntax, but more memorable and clearer, because the template name is self-documenting.

Example

Category:Diachronic conlangs