Template:Comment/doc
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 <!--This is a comment-->
—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>{{comment| ... }}</tt></span>
and <!-- ... -->
coding is that <span style="white-space:nowrap;"><tt>{{comment}}</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.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Comment | 1 | 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. | String | required |