Difference between revisions of "Template:Tag"

From The Coppermind
Jump to navigation Jump to search
m (support extra classes)
m (All fixed; I don't see a need to keep this tracking around)
Tag: Undo
 
(3 intermediate revisions by 2 users not shown)
Line 4: Line 4:
   
 
CATEGORY
 
CATEGORY
-->[[Category:{{{cat|{{{1}}}|}}}]]<!--
+
-->[[category: {{{cat|{{{1}}}|}}}]]<!--
--><span class="cm-tag-cat-link cm-tracking-link" style="display: none;">[[:category: {{{cat|{{{1}}}|}}}]]</span><!--
+
--><span class="cm-tag-cat-link cm-tracking-list" style="display: none;">[[:category: {{{cat|{{{1}}}|}}}|{{{list-text|&#x1F431;&#xFE0E;}}}]]</span><!--
   
 
--></span></includeonly><noinclude>
 
--></span></includeonly><noinclude>

Latest revision as of 05:53, 16 August 2020

The tag template is a link macro template that links to a page and applies a category. It's best to use it on the page's infobox rather than in the text proper.

Template[edit]

Note: Replace {{1}} with an actual parameter.

{{tag |{{1}} |cat= |text= }}

Parameters[edit]

Highlighted lines indicate mandatory parameters.

Positional parameters are indicated with {{N}} in their name. For example, {{1}} means "the first template parameter".

{{Tag}} Parameters
Parameter Description Examples
{1} Use the first parameter to create a link and add the page to a category with the same name.

|Diagram

cat Use this to add this page to a category named differently than the first parameter; if cat is used, the first parameter serves only as a page link.

Note: This is useful in cases such as when the first parameter links to a disambiguation page; for example, {{tag|Diagram}} would add the page to Category:Diagram and link to Diagram, while {{tag|Diagram (group)|cat=Diagram}} adds the page to Category:Diagram and links to Diagram (group).

|cat=Diagram

link Use this to change which page the tag links to.

Note: To follow from the above example, {{tag|Diagram|link=Diagram (group)}} adds the page to Category:Diagram, links to Diagram (group) and displays the tag as Diagram.

|link=Diagram (group)

text Use this to change how the tag is displayed on the page.

Note: To follow from the above example, {{tag|Diagram (group)|cat=Diagram|text=Patriots}} adds the page to Category:Diagram, links to Diagram (group) and displays the tag as Patriots.

|text=Patriots

Articles using Template[edit]