Difference between revisions of "Template:Tag"

From Krafties
Jump to navigation Jump to search
m
m
 
(30 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude>{|style="width:90%;margin:auto;border:2px solid {{{1|#bbdbfc}}};background:white;border-collapse:collapse;"
+
{{#if:{{{plain|}}}|
!style="background:{{{1|#bbdbfc}}};color:{{{2|black}}};"|{{{3}}}
+
|<code style="white-space:nowrap">
|-
+
}}{{#switch:{{{2|pair}}}
|style="text-align:center;padding:3px;"|{{{4}}}
+
|c|close  = <!--nothing-->
|}</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.
 
===<code><nowiki>{{Tag||||}}</nowiki></code>===
 
:How to fill in <code><nowiki>{{Tag|1|2|3|4}}</nowiki></code>
 
:#Header BACKGROUND color
 
:#Header FONT color
 
:#Tag heading
 
:#Tag content
 
}}
 

Latest revision as of 15: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>