Template:Ping/doc: Difference between revisions

From Meta Wiki
Jump to navigation Jump to search
m 1 revision imported
MeowyCats2 (talk | contribs)
m 6 revisions imported
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{hatnote|[[Template:Pin]] redirects here. You may be looking for [[Template:Pin section]].}}
{{Documentation subpage}}
{{Documentation subpage}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{template shortcut|re|reply}}
{{template shortcut|ping|re|replyto|reply|yo}}
{{Lua|Module:Reply to}}
{{Lua|Module:Reply to}}
{{High-risk|approximately 140,000}}


This template is used to link one or more users' names, in the form "<kbd>@Username:</kbd>", to trigger a [[Wikipedia:Notifications|notification]] for user(s) you are replying to in a discussion. The notification will work successfully only if you sign your post in the same edit in which you use this template. If you make a mistake in placing this template or in signing, see [[Help:Fixing failed pings]]. It is an alternative to the {{tl|talkback}} template. It works on any talk page or Wikipedia namespace page.
This template is used to link one or more users' names, in the form "<kbd>@Username:</kbd>", to trigger a [[mw:Notifications|notification]] for user(s) you are replying to in a discussion. The notification will work successfully only if you sign your post in the same edit in which you use this template. It works on any talk page or Project namespace page.


'''You cannot directly type the "@" symbol to notify a user of your reply, you must use the template documented here or manually create a [[WP:WIKILINK|wikilink]] to their [[WP:USERPAGE|user page]].<br /> The "@" symbol is used by this template for display purposes only.'''
'''You cannot directly type the "@" symbol to notify a user of your reply, you must use the template documented here or manually create a [[w:WP:WIKILINK|wikilink]] to their [[w:WP:USERPAGE|user page]].<br /> The "@" symbol is used by this template for display purposes only.'''


This template is particularly helpful in discussions that are not threaded, to indicate which user's comment is referenced. If you feel that this template unnecessarily personalizes the discussion, you may still use the {{tl|talkback}} template on the user's talk page to indicate that you have replied to a comment. IP addresses are only notified if you post to their user talk page.
This template is particularly helpful in discussions that are not threaded, to indicate which user's comment is referenced. If you feel that this template unnecessarily personalizes the discussion, you may still post on the user's talk page to indicate that you have replied to a comment. IP addresses are only notified if you post to their user talk page.


== Usage ==
==Usage==
<nowiki>{{reply to|Username}} Message text. ~~~~</nowiki>
{| class="wikitable"
 
!Template !! Result
The edit that adds this template '''must''' meet the following requirement for notifications to work:
|-
 
|{{tlx|ping|Example}} || {{ping|Example}}
* The edit must add new lines of text, not just edit existing lines.
|-
* The edit must be signed by adding <code><nowiki>~~~~</nowiki></code> to the end of the message.
|{{tlx|ping|Example|John}} || {{ping|Example|John}}
** If you have specified a custom signature, it must contain a plain wiki link (<code>[[ ]]</code>) to your user page, user talk page, or contributions page; it cannot be embedded in a template.
|}
* The edit must either be entirely within an existing sections (it cannot have new section headers in the middle) or start a new section (starts with a new section header).
** Only sections of level 2 and above count.
* If the number of detected to-be-pinged users exceeds 50, no notifications will be delivered.
 
See [[Wikipedia:Notifications]] and [[:mw:Help:Echo#Technical details]] for more information.
 
It is not necessary to use this template to ping the user if you are already linking to the username from your post, neither is it necessary when posting on their own talk page.
 
Note: Wikipedia does not support using the at sign in a reply to notify the user you are replying to, as many discussion boards do. While Wikipedia shows the results of using this template with an at sign, you must either use a template or directly link to the user's user page (e.g. <code><nowiki>[[User:Example|@Example]]</nowiki></code>) to ping them.
 
<code><s><nowiki>@Username Message text. ~~~~</nowiki></s></code> '''''DOES NOT WORK'''''


=== Single recipient ===
=== Single recipient ===
Use the following syntax:
Use the following syntax:
  <nowiki>{{reply to|Username}} Message text. ~~~~</nowiki>
  <nowiki>{{ping|Username}} Message text. ~~~~</nowiki>
 
For example, <code>{{tlx|ping|Example}}</code> generates "@[[User:Example|Example]]:" and notifies [[User:Example|Example]]
For example, <code>{{tlf|Reply to|Jimbo Wales}}</code> generates "@{{noping|Jimbo Wales}}:" and notifies {{noping|Jimbo Wales}}
 
The comment must be signed and belong to a named section of a "Talk" or "Wikipedia" namespace page in order for the notification to work.
 
=== Multiple recipients ===


=== Multiple recipient ===
You can reply to up to 50 people at once. Use the following syntax:
You can reply to up to 50 people at once. Use the following syntax:
  <nowiki>{{reply to|User1|User2|User3|User4|User5|User6|User7|User8|User9|User10|...}} Message text. ~~~~</nowiki>
  <nowiki>{{ping|User1|User2|User3|User4|User5|User6|User7|User8|User9|User10|...}} Message text. ~~~~</nowiki>


For example, <code><nowiki>{{reply to|Example|Jimbo Wales}}</nowiki></code> will produce:
For example, <code><nowiki>{{ping|Example|John}}</nowiki></code> will produce:


{{reply to|Example|Jimbo Wales}}
{{ping|Example|John}}


[[File:Ambox warning pn.svg|20px|link=|alt=⚠]]&nbsp;'''<span style="color:red;">''Warning:''</span> If the total number of detected to-be-pinged users in an edit exceeds 50, no notifications will be delivered.''' This is a software limit, and applies to the entire edit, even if the mentions are split between multiple templates. If you need to ping more than 50 users, it will need to be spread across multiple edits, and each edit needs to add new lines and be signed by you.
[[File:Ambox warning pn.svg|20px|link=|alt=⚠]]&nbsp;'''<span style="color:red;">''Warning:''</span> If the total number of detected to-be-pinged users in an edit exceeds 50, no notifications will be delivered.''' This is a software limit, and applies to the entire edit, even if the mentions are split between multiple templates. If you need to ping more than 50 users, it will need to be spread across multiple edits, and each edit needs to add new lines and be signed by you.
=== Specify a nickname ===
You can display any text in place of a username by using {{para|labelX}}, where X is the index of a positional parameter, counting from 1. For example:
:"<code>{{tlf|reply to|2=Example|3=label1=Exemplar|4=Example2|5=label2=John}}</code>" produces "{{reply to|Example|label1=Exemplar|Example2|label2=John}}"
You can also use {{para|label}} in place of {{para|label1}}. For example:
:"<code>{{tlf|reply to|2=Example|3=label=John}}</code>" produces "{{reply to|Example|label=John}}"
=== Specify a prefix ===
To change the "@" prefix, use {{para|prefix|''custom prefix''}}. For example:
:"<code>{{tlf|reply to|Example|3=prefix=Hello&amp;nbsp; }}</code>" produces "{{reply to|Example|prefix=Hello&nbsp;}}"
Or you can remove the prefix entirely by using {{para|prefix}}. For example:
:"<code>{{tlf|reply to|Example|3=prefix=}}</code>" produces "{{reply to|Example|prefix=}}"
=== Customise punctuation ===
By default, the template will insert a colon after the final name. To change this, specify the required character using the {{para|p}} parameter. For example:
:"<code>{{tlf|reply to|Example|3=p=—}}</code>" produces "{{reply to|Example|p=—}}"
The parameter omits leading or trailing spaces. Use <code>&amp;nbsp;</code> instead. For example:
:"<code>{{tlf|reply to|Example|3=p=&amp;nbsp;–}} Text message</code>" produces "{{reply to|Example|p=&nbsp;–}} Text message"
To simply remove the colon, use the parameter with an empty value:
:"<code>{{tlf|reply to|Example|3=p=}}</code>" produces "{{reply to|Example|p=}}"
=== Customise conjunction ===
By default, the template will use the word "and" between multiple names. To change this, specify the required conjunction using the {{para|c}} parameter. For example:
:"<code>{{tlf|reply to|Example|Example2|4=c=or}}</code>" produces "{{reply to|Example|Example2|c=or}}"
:"<code>Neither {{tlf|reply to|Example|Example2|Example3|5=c=nor}}</code>" produces "Neither {{reply to|Example|Example2|Example3|c=nor}}"
To simply remove the conjunction, use the parameter with an empty value:
:"<code>{{tlf|reply to|Example|Example2|4=c=}}</code>" produces "{{reply to|Example|Example2|c=}}"
=== Or don't use! ===
If you are using the {{para|prefix}} and {{para|p}} together to just display one user name, then there is no need to use this template. Simply code <code>&#x5B;[User:''username''|]]</code> or {{tlx|u|''username''}}. This will generate the same notifications as are generated by the template.
=== Error messages ===
====Username not given====
Sometimes, when the recipient's username contains an equal sign, for example <code><nowiki>{{reply to|test=test}}</nowiki></code>, it will show:<br />
{{reply to|test=test}}
<br />
To fix this, simply add 1= at the beginning of the username, 2= at the second username, 3= at the third username and so on:<br />
<code><nowiki>{{reply to|1=test=test}}</nowiki></code>
====More than 50 names specified====
If more than 50 names are specified in the template, it will show:
{{reply to|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51}}
This is a limitation of the notification system, as documented at [[:mw:Manual:Echo]]. Note that the system limitation is ''per edit'', so while splitting a longer list between two templates will avoid this error message, none of the notifications will be sent. In the rare case you need to notify more than 50 people, it will need to be done in multiple edits.
== Redirects ==
* {{Tlx|Ping}}
* {{Tlx|Re}}
* {{Tlx|Replyto}}
* {{Tlx|Reply}}
* {{Tlx|Yo}}
* {{Plain link|url={{fullurl:Special:WhatLinksHere/Template:Reply to|hidelinks=1&hidetrans=1}}|name=''Complete list of (alias) redirects''}}<!-- checks WhatLinksHere to template, not doc -->
== TemplateData ==
{{TemplateData header}}
<templatedata>
{
"params": {
"1": {
"label": "Username #1",
"description": "The name of the first user that you want to notify",
"type": "wiki-user-name",
"required": true
},
"2": {
"label": "Username #2",
"description": "The name of the second user you want to notify (optional)",
"type": "wiki-user-name"
},
"3": {
"label": "Username #3",
"description": "The name of the third user you want to notify (optional)",
"type": "wiki-user-name"
},
"4": {
"label": "Username #4",
"description": "The name of the fourth user you want to notify (optional)",
"type": "wiki-user-name"
},
"5": {
"label": "Username #5",
"description": "The name of the fifth user you want to notify (optional)",
"type": "wiki-user-name"
},
"6": {
"label": "Username #6",
"description": "The name of the sixth user you want to notify (optional)",
"type": "wiki-user-name"
},
"7": {
"label": "Username #7",
"description": "The name of the seventh user you want to notify (optional)",
"type": "wiki-user-name"
},
"8": {
"label": "Username #8",
"description": "The name of the eighth user you want to notify (optional)",
"type": "wiki-user-name"
},
"9": {
"label": "Username #9",
"description": "The name of the ninth user you want to notify (optional)",
"type": "wiki-user-name"
},
"10": {
"label": "Username #10",
"description": "The name of the tenth user you want to notify (optional)",
"type": "wiki-user-name"
},
"label1": {
"aliases": [
"label"
],
"label": "Label #1",
"description": "An alternative nickname to be displayed instead of the first username (optional)",
"type": "string"
},
"c": {
"label": "Conjunction",
"description": "Custom conjunction to be displayed between the last two names (defaults to 'and')",
"type": "string",
"default": "and",
"autovalue": ""
},
"label2": {
"label": "Label #2",
"description": "An alternative nickname to be displayed instead of the second username (optional)",
"type": "string"
},
"label3": {
"label": "Label #3",
"description": "An alternative nickname to be displayed instead of the third username (optional)",
"type": "string"
},
"label4": {
"label": "Label #4",
"description": "An alternative nickname to be displayed instead of the fourth username (optional)",
"type": "string"
},
"label5": {
"label": "Label #5",
"description": "An alternative nickname to be displayed instead of the fifth username (optional)",
"type": "string"
},
"label6": {
"label": "Label #6",
"description": "An alternative nickname to be displayed instead of the sixth username (optional)",
"type": "string"
},
"label7": {
"label": "Label #7",
"description": "An alternative nickname to be displayed instead of the seventh username (optional)",
"type": "string"
},
"label8": {
"label": "Label #8",
"description": "An alternative nickname to be displayed instead of the eighth username (optional)",
"type": "string"
},
"label9": {
"label": "Label #9",
"description": "An alternative nickname to be displayed instead of the ninth username (optional)",
"type": "string"
},
"label10": {
"label": "Label #10",
"description": "An alternative nickname to be displayed instead of the tenth username (optional)",
"type": "string"
},
"p": {
"label": "End punctuation",
"description": "Custom punctuation to be displayed after the final name (defaults to ':')",
"type": "string",
"default": ":",
"autovalue": ""
},
"prefix": {
"label": "Prefix",
"description": "Custom prefix to be displayed before the first name (defaults to '@')",
"type": "string",
"default": "@"
}
},
"description": "Trigger a notification to one or several registered user(s) you are replying to in a discussion.",
"paramOrder": [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"label1",
"label2",
"label3",
"label4",
"label5",
"label6",
"label7",
"label8",
"label9",
"label10",
"p",
"c",
"prefix"
]
}
</templatedata>


== See also ==
== See also ==
* [[Module:Reply to]] – the Lua module on which this template is based
{{#lst:Template:Template list|inline-talk-templates}}
* {{tl|user link}} – Links to a single user's page (without the @ sign and colon)
__NOTOC__
* {{tl|hidden ping}} – Notifies one or more users without displaying any text
* {{tl|noping}} – Links a user's name without triggering the Echo notification system
* {{tl|to}} – Uses "To " (with a space) at the beginning instead of the @ sign
* {{t|talkback}} – Allows a user to direct the attention of another user to a discussion via a notification
* {{subst:[[Template:Ping fix|Ping fix]]}} – User namespace template used to notify a user that they used <nowiki>{{reply to}}</nowiki> incorrectly
* [[:mw:Manual:Echo|Manual:Echo]] – the manual page for the underlying ''Echo'' feature that provides the notifications
* [[Help:Fixing failed pings]]
* {{subst:[[Template:Plsping|Please ping]]}} – generates this: <small>(please use {{tlx|ping|Example}} on reply)</small>
 
{{Inline talk templates}}
<includeonly>{{Sandbox other||
 
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Inline talk templates]]
[[Category:Username internal link templates]]
}}</includeonly>

Latest revision as of 07:55, 21 December 2024

Lua error: bad argument #1 to "get" (not a valid title).

This template is used to link one or more users' names, in the form "@Username:", to trigger a notification for user(s) you are replying to in a discussion. The notification will work successfully only if you sign your post in the same edit in which you use this template. It works on any talk page or Project namespace page.

You cannot directly type the "@" symbol to notify a user of your reply, you must use the template documented here or manually create a wikilink to their user page.
The "@" symbol is used by this template for display purposes only.

This template is particularly helpful in discussions that are not threaded, to indicate which user's comment is referenced. If you feel that this template unnecessarily personalizes the discussion, you may still post on the user's talk page to indicate that you have replied to a comment. IP addresses are only notified if you post to their user talk page.

Usage[edit source]

Template Result
{{ping|Example}} @Example:
{{ping|Example|John}} @Example and John:

Single recipient[edit source]

Use the following syntax:

{{ping|Username}} Message text. ~~~~

For example, {{ping|Example}} generates "@Example:" and notifies Example

Multiple recipient[edit source]

You can reply to up to 50 people at once. Use the following syntax:

{{ping|User1|User2|User3|User4|User5|User6|User7|User8|User9|User10|...}} Message text. ~~~~

For example, {{ping|Example|John}} will produce:

@Example and John:

⚠ Warning: If the total number of detected to-be-pinged users in an edit exceeds 50, no notifications will be delivered. This is a software limit, and applies to the entire edit, even if the mentions are split between multiple templates. If you need to ping more than 50 users, it will need to be spread across multiple edits, and each edit needs to add new lines and be signed by you.

See also[edit source]

{{#lst:Template:Template list|inline-talk-templates}}