Template:Comment/doc: Difference between revisions

From Saintapedia
Jump to navigation Jump to search
>Rusty.perrin
(→‎Appearance in Visual Editor: Take out column width guides)
 
>Tom.Reding
m (→‎top: {{High-use}})
Line 1: Line 1:
This template is intended as an potentially easier to remember coding for comments than the wiki comment coding. So {{tlx|Comment | This is a comment}} should have the same effect as {{code|<nowiki><!--This is a comment--></nowiki>}}—the {{xt|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 {{code|<nowiki>{{comment |</nowiki>}} and the {{code|<nowiki>}}</nowiki>}} will simply be ignored when the article is displayed.
{{Documentation subpage}}
{{High-use}}


== Appearance in Visual Editor ==
==Usage==
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.  
<syntaxhighlight lang="wikitext">{{Comment}} Your comment here.</syntaxhighlight> produces "{{Comment}} Your comment here."
You can also use {{tlp|comment|optional word}} to put a word instead of "comment": <syntaxhighlight lang="wikitext">{{comment|Note}}</syntaxhighlight> produces {{comment|Note}}.


{| class=wikitable
== TemplateData ==
|
{{TemplateDataHeader}}
! Wiki comment coding appearance !! Comment template appearance
<templatedata>{
|- valign=top
  "description": "Indicates the insertion of a comment in a discussion.  Displays an icon and a text string; takes one optional parameter which defines the text string.",
! Initial appearance on the edit screen:
  "params": {
| [[File:Wikicode comment appearance in visual editor.png | 155px]] || [[File:Comment template appearance in visual editor.png | 89px]]
    "1": {
|- valign=top
      "label": "Display text",
! Appearance when you click on it:
      "description": "Text which will replace default text; e.g. Note.",
| [[File:Wikicode comment appearance in visual editor after clicking.png | 345px]] || [[File:Comment template appearance in visual editor after clicking.png | 349px]]
      "type": "string",
|- valign=top
      "default": "Comment",
! Appearance when you click edit:  
      "required": false
| [[File:Wikicode comment appearance in visual editor after clicking edit.png | 348px]] || [[File:Comment template appearance in visual editor after clicking edit.png | 433px]]
    }
|}
  }
}</templatedata>


==Example==
==See also==
One difference between using {{code|{{tld|comment| ...&nbsp;}}}} and {{code|<nowiki><!-- ... --></nowiki>}} coding is that {{Code|{{tld|comment}}}} 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.
* {{tl|A note}}
{| class=wikitable
* {{tl|Nacmt}} (Non-admin comment)
! Code !! Result
* {{tl|HTML comment}}
|- valign=top
{{Done/See also}}
| width=50% |
{{pre|<nowiki>
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.
</nowiki>}}
| width=50% |
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.
|- valign=top
|
{{pre|<nowiki>
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.
</nowiki>}}
|
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.


|}
<includeonly>{{Sandbox other||
 
<!-- Categories below this line, please; interwikis at Wikidata -->
==Template data==
[[Category:Image with comment templates]]
<templatedata>
}}</includeonly>
{
"params": {
"1": {
"label": "Comment",
"description": "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.",
"type": "string",
"required": true
}
},
"description": "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.",
"paramOrder": [
"1"
]
}
</templatedata>

Revision as of 13:37, 26 December 2023

Usage

{{Comment}} Your comment here.

produces " Your comment here." You can also use {{comment|optional word}} to put a word instead of "comment":

{{comment|Note}}

produces .

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Comment in articles based on its TemplateData.

TemplateData for Comment

Indicates the insertion of a comment in a discussion. Displays an icon and a text string; takes one optional parameter which defines the text string.

Template parameters

ParameterDescriptionTypeStatus
Display text1

Text which will replace default text; e.g. Note.

Default
Comment
Stringoptional

See also

Template:Done/See also