Difference between revisions of "Template:Tag"

From Krafties
Jump to navigation Jump to search
m
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
Î{{#if:{{{plain|}}}|
+
{{#if:{{{plain|}}}|
 
  |<code style="white-space:nowrap">
 
  |<code style="white-space:nowrap">
 
}}{{#switch:{{{2|pair}}}
 
}}{{#switch:{{{2|pair}}}
Line 21: Line 21:
 
{{documentation}}
 
{{documentation}}
  
<!---<onlyinclude>{|style="width:90%;margin:5px auto;border:2px solid {{{background|SlateBlue}}};background:white;border-collapse:collapse;95%"
+
</noinclude>
!style="background:{{{background|SlateBlue}}};color:{{{color|white}}};"|{{{title}}}
 
|-
 
|style="text-align:{{{align|center}}};padding:3px;"|{{{message}}}
 
|}<br></onlyinclude>
 
 
 
{|{{TemplateExplanation}}[[Category:Tag Templates]]
 
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|title=|message=}}</nowiki></code>
 
:*<code>title=</code>Tag heading
 
:*<code>message=</code>Tag content
 
:*<code>align=</code> '''optional''', lets you change the text-align of the message
 
 
 
===With Custom Color for border/title===
 
:To add custom color, just add these in the commands (no special order, just add them behind the order-sensitive commands if any)
 
:*<code><nowiki>color=</nowiki></code> font color in {{monospace|HTML colorname}}, {{monospace|HEX}} or {{monospace|rgb()}}
 
:*<code><nowiki>background=</nowiki></code> bacground/border color in {{monospace|HTML colorname}}, {{monospace|HEX}} or {{monospace|rgb()}}
 
 
 
==When creating new tag templates==
 
:Please add the [[Template:Tag/help|Tag/help]] template at the end within the [[Template:Template Explanation|Template Explanation]], it adds the basic information
 
==See Also==
 
|}
 
---></noinclude>
 

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>