Template:Comment/doc

From USApedia
< Template:Comment
Revision as of 13:58, 16 May 2019 by >Rusty.perrin (→‎Appearance in Visual Editor: Take out column width guides)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This template is intended as an potentially easier to remember coding for comments than the wiki comment coding. So {{Comment | This is a comment}} should have the same effect as &lt;!--This is a comment--&gt;—the This is a comment text will be visible in the edit window when editing an article, but will not appear when the article is viewed normally. Anything between the {{comment | and the }} will simply be ignored when the article is displayed.

Appearance in Visual Editor

Comments look different in Visual Editor, depending on whether wiki comment coding is used or the comment template. This difference only shows up when editing—either way comments are invisible when just viewing the page.

Wiki comment coding appearance Comment template appearance
Initial appearance on the edit screen: File:Wikicode comment appearance in visual editor.png File:Comment template appearance in visual editor.png
Appearance when you click on it: File:Wikicode comment appearance in visual editor after clicking.png File:Comment template appearance in visual editor after clicking.png
Appearance when you click edit: File:Wikicode comment appearance in visual editor after clicking edit.png File:Comment template appearance in visual editor after clicking edit.png

Example

One difference between using <span style="white-space:nowrap;"><tt>&#123;&#123;comment&#124; ...&nbsp;&#125;&#125;</tt></span> and &lt;!-- ... --&gt; coding is that <span style="white-space:nowrap;"><tt>&#123;&#123;comment&#125;&#125;</tt></span> allows nesting of comments within comments, which can be handy if, in a template for instance, you are commenting out a block of wikicode that itself includes comments.

Code Result
This text is before the comment.
{{comment | This text is the comment itself. 
   {{comment | The comment has a comment within it. }}
This text is intended to still be part of the initial comment. }}
This text is after the comment.

This text is before the comment.

This text is after the comment.

This text is before the comment.
<!-- This text is the comment itself. 
   <!-- The comment has a comment within it --> 
This text is intended to still be part of the initial comment. -->
This text is after the comment.

This text is before the comment. This text is intended to still be part of the initial comment. --> This text is after the comment.

Template data

The comment template is solely to leave information for other editors that will be visible when editing the page but invisible when just viewing the page.

Template parameters

ParameterDescriptionTypeStatus
Comment1

Enter any text here that may be useful for other editors. It will not impact the page for people viewing the page—it is only visable when editing the page.

Stringrequired