Difference between revisions of "Template:Tag"

From Krafties
Jump to navigation Jump to search
m
m
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude>{|style="width:90%;margin:5px auto;border:2px solid {{{3|SlateBlue}}};background:white;border-collapse:collapse;95%"
+
{{#if:{{{plain|}}}|
!style="background:{{{3|SlateBlue}}};color:{{{4|white}}};"|{{{1}}}
+
|<code style="white-space:nowrap">
|-
+
}}{{#switch:{{{2|pair}}}
|style="text-align:center;padding:3px;"|{{{2}}}
+
|c|close  = <!--nothing-->
|}<br></onlyinclude>
+
|s|single
 +
|o|open
 +
|p|pair  = &lt;{{{1|tag}}}{{#if:{{{params|}}}|&#32;{{{params}}}}}
 +
}}{{#switch:{{{2|pair}}}
 +
|c|close  = {{{content|}}}
 +
|s|single = &#32;&#47;&gt;
 +
|o|open  = &gt;{{{content|}}}
 +
|p|pair  = &gt;{{{content|...}}}
 +
}}{{#switch:{{{2|pair}}}
 +
|s|single
 +
|o|open  = <!--nothing-->
 +
|c|close
 +
|p|pair  = &lt;&#47;{{{1|tag}}}&gt;
 +
}}{{#if:{{{plain|}}}|
 +
|</code>
 +
}}<noinclude>
 +
{{documentation}}
  
{{TemplateExplanation|[[Category:Tag Templates]]
+
</noinclude>
This template is made to unify the overall design of all [[:Category:Tag Templates|Tag Templates]]. But each tag can customize the color design.
 
:;This tag does not add any category, can be used as a General Notice tag
 
===Default Colors - <code><nowiki>{{Tag||}}</nowiki></code>===
 
:How to fill <code><nowiki>{{Tag|1|2}}</nowiki></code>
 
:#Tag heading
 
:#Tag content
 
 
 
===With Custom Color - <code><nowiki>{{Tag||||}}</nowiki></code>===
 
:How to fill in <code><nowiki>{{Tag|1|2|3|4}}</nowiki></code>
 
:#Tag heading
 
:#Tag content
 
:#HEADER color '''(optional)'''
 
:#Header FONT color '''(optional)'''
 
 
 
}}
 

Latest revision as of 16:11, 3 May 2017

<tag>...</tag>

Documentation icon Template documentation ( view · talk · edit)
For the page status indicator Phabricator tags, see Template:ptag.

This template provides a quick way to mention an XML-style tag in a preformatted way. Mainly used in discussion/help pages.

Usage[edit]

  • first parameter(mandatory) the name of the HTML tag
  • second parameter — what type of tag to display:
    • p or pair(default) display a matched pair of open-and-close tags: <font>...</font>
    • o or open – display only the opening tag of an open-and-close pair: <span>
    • c or close – display only the closing tag of an open-and-close pair: </span>
    • s or single – display a single tag: <br />
  • content= — the text content of the tags
  • params= — any parameters to be included in the opening tag

Examples[edit]

  • {{tag|ref}}<ref>...</ref>
  • {{tag|ref|content=hello}}<ref>hello</ref>
  • {{tag|font|content=foo}}<font>foo</font>
  • {{tag|font|open}}<font>
  • {{tag|font|open|content=hello}}<font>hello
  • {{tag|span|close|content=hello}}hello</span>
  • {{tag|span|pair|content=hello}}<span>hello</span>
  • {{tag|ref|open|params=group=note}}<ref group=note>
  • {{tag|references|single}}<references />
  • {{tag|br|single}}<br />
The above documentation is transcluded from Template:Tag/doc.
Editors can experiment in this template's sandbox
Please add categories to the /doc subpage within <includeonly>...</includeonly>