Template talk:Tag
Latest comment: 13 years ago by Adrignola in topic Update 3
Template:Tag is permanently protected from editing, as it is a heavily used or visible template. Substantial changes should be proposed here, and made by administrators, if the proposal is uncontroversial or has been discussed and is supported by consensus. Use {{editprotected}} to attract the attention of an administrator in such cases. Any contributor may edit the template's documentation to add usage notes, categories or interlanguage links. |
Update
[edit source]{{editprotected}} Can the code be updated to the following? This ensures proper display of the single XHTML tags (added a space), and makes {{{content}}} also show with open and close. Updated code from en:Template:Tag. Edokter (talk) 15:45, 14 January 2011 (UTC)
<code style="white-space:nowrap;">{{#switch:{{{2|pair}}}
|close
|single = <!--nothing-->
|open
|pair
|#default = <{{{1|tag}}}{{#if:{{{params|}}}| {{{params}}}}}>
}}{{#switch:{{{2|pair}}}
|single = <!--nothing-->
|open
|close
|pair
|#default = {{{content|}}}
}}{{#switch:{{{2|pair}}}
|open
|single = <!--nothing-->
|close
|pair
|#default = </{{{1|tag}}}>
}}{{#switch:{{{2|pair}}}
|single = <{{{1|tag}}}{{#if:{{{params|}}}| {{{params}}}}} />
}}</code><noinclude>
{{documentation}}
</noinclude>
- Done. Thanks for letting us know. It's hard to track all the templates' changes at en.wiki. – Adrignola talk 15:52, 14 January 2011 (UTC)
Update 2
[edit source]{{editprotected}} Optimized code and added shortcuts. Edokter (discuss • contribs) 12:45, 23 January 2011 (UTC)
<code style="white-space:nowrap;">{{#switch:{{{2|pair}}}
|c|close = <!--nothing-->
|s|single
|o|open
|p|pair = <{{{1|tag}}}{{#if:{{{params|}}}| {{{params}}}}}
}}{{#switch:{{{2|pair}}}
|c|close = {{{content|}}}
|s|single =  />
|o|open
|p|pair = >{{{content|}}}
}}{{#switch:{{{2|pair}}}
|s|single
|o|open = <!--nothing-->
|c|close
|p|pair = </{{{1|tag}}}>
}}</code><noinclude>
{{documentation}}
</noinclude>
Update 3
[edit source]{{editprotected}} Established convention uses "..." to seperate begin- and end tags with no content. Please replace:
|o|open |p|pair = >{{{content|}}}
with:
|o|open = >{{{content|}}} |p|pair = >{{{content|...}}}
Thank you. — Edokter (talk) — 23:19, 19 June 2011 (UTC)