Template:Comment: Difference between revisions

From CTLTMS
m (1 revision)
CTLTMS>Anw
m (Minor formatting change)
Line 1: Line 1:
<noinclude>
<noinclude>
=== Synopsis ===
;Unnamed (positional) parameters
<code><nowiki>{{comment|comment|person|date}}</nowiki></code>
; Named parameters
<code><nowiki>{{comment|text=phrase|sign=person|date=date}}</nowiki></code>
=== Example ===
; Wikitext:
; Wikitext:
<code><nowiki>{{quote|text=Cry “Havoc,” and let slip the dogs of war.|sign=[[William Shakespeare]]|date=01/01/1889}}</nowiki></code>
<code><nowiki>{{quote|text=Cry “Havoc,” and let slip the dogs of war.|sign=[[William Shakespeare]]|date=01/01/1889}}</nowiki></code>
Line 20: Line 10:
If you do not provide quoted text, the template generates a parser error message, which will appear in red text in the rendered page.
If you do not provide quoted text, the template generates a parser error message, which will appear in red text in the rendered page.


If any parameter's actual value contains an [[equals sign]] (=), you '''''must''''' use named parameters.  (The equals sign gets interpreted as a named parameter otherwise.)
If any parameter's actual value contains an equals sign (=), you '''''must''''' use named parameters.  (The equals sign gets interpreted as a named parameter otherwise.)


If any parameter's actual value contains characters used for wiki markup syntax (such as [[vertical bar|pipe]], [[brackets]], single quotation marks, etc.), you may need to escape it.  See [[Template:!]] and friends.
If any parameter's actual value contains characters used for wiki markup syntax (such as vertical bar, brackets, single quotation marks, etc.), you may need to escape it.  See [[Template:!]] and friends.


Be wary of URLs which contain restricted characters.  The equals sign is especially common.
Be wary of URLs which contain restricted characters.  The equals sign is especially common.
[[Category:Templates|{{PAGENAME}}]]
[[Category:Templates|{{PAGENAME}}]]
</noinclude>
<templatedata>
{
"params": {
"text": {
"aliases": [
"1"
],
"label": "Text",
"description": "Quoted/commented text",
"type": "string",
"required": true
},
"sign": {
"aliases": [
"2"
],
"label": "Person",
"description": "Quoted/commenting person",
"type": "wiki-user-name",
"required": true
},
"date": {
"aliases": [
"3"
],
"label": "Date",
"description": "Date of comment",
"type": "date",
"required": true
}
},
"description": "Inserts a comment or quote callout."
}
</templatedata>
</noinclude><includeonly>
<blockquote class="templatequote"><div>{{{text|{{{1|<noinclude>Your comment here</noinclude><includeonly>{{error|Error: No text given for quotation (or equals sign used in the actual argument to an unnamed parameter)}}</includeonly>}}}}}}
<blockquote class="templatequote"><div>{{{text|{{{1|<noinclude>Your comment here</noinclude><includeonly>{{error|Error: No text given for quotation (or equals sign used in the actual argument to an unnamed parameter)}}</includeonly>}}}}}}
</div>{{#if:{{{sign|{{{2|<noinclude>TRUE</noinclude>}}}}}}|<div class="templatequotecite">&#8212;{{{sign|{{{2|<noinclude>Someone</noinclude>}}}}}}{{#if:{{{date|{{{3|<noinclude>TRUE</noinclude>}}}}}}|,&nbsp;<cite>{{{date|{{{3|<noinclude>''Date''</noinclude>}}}}}}</cite>}}</div >}}</blockquote><noinclude>
</div>{{#if:{{{sign|{{{2|<noinclude>TRUE</noinclude>}}}}}}|<div class="templatequotecite">&#8212;{{{sign|{{{2|<noinclude>Someone</noinclude>}}}}}}{{#if:{{{date|{{{3|<noinclude>TRUE</noinclude>}}}}}}|,&nbsp;<cite>{{{date|{{{3|<noinclude>''Date''</noinclude>}}}}}}</cite>}}</div >}}</blockquote><noinclude>
</noinclude>
</noinclude>

Revision as of 08:32, 26 July 2024

Wikitext

{{quote|text=Cry “Havoc,” and let slip the dogs of war.|sign=[[William Shakespeare]]|date=01/01/1889}}

Result
Cry “Havoc,” and let slip the dogs of war.
—William Shakespeare, 01/01/1889

Restrictions

If you do not provide quoted text, the template generates a parser error message, which will appear in red text in the rendered page.

If any parameter's actual value contains an equals sign (=), you must use named parameters. (The equals sign gets interpreted as a named parameter otherwise.)

If any parameter's actual value contains characters used for wiki markup syntax (such as vertical bar, brackets, single quotation marks, etc.), you may need to escape it. See Template:! and friends.

Be wary of URLs which contain restricted characters. The equals sign is especially common.

Inserts a comment or quote callout.

Template parameters

ParameterDescriptionTypeStatus
Texttext 1

Quoted/commented text

Stringrequired
Personsign 2

Quoted/commenting person

Userrequired
Datedate 3

Date of comment

Daterequired

}}}}}}

—Someone, Date