Jump to content

Template talk:Reply to

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

"Template:Ui" listed at Redirects for discussion

[edit]

An editor has identified a potential problem with the redirect Template:Ui and has thus listed it for discussion. This discussion will occur at Wikipedia:Redirects for discussion/Log/2022 January 17#Template:Ui until a consensus is reached, and readers of this page are welcome to contribute to the discussion. Q28 (talk) 12:05, 17 January 2022 (UTC)[reply]

Rewrite

[edit]

I rewrote the module to greatly simplify it, taking advantage of the mw.text.listToText function, at Module:Reply to/sandbox (and implemented at Template:Reply to/sandbox). It passes all the testcases, and the only change to the output text is that it fixes a bug that had caused multiple spaces to be inserted after the penultimate list item. Since this is a very widely used template, I thought I'd open it up to public review before copying it to the main template. --Ahecht (TALK
PAGE
) 18:21, 30 March 2022 (UTC)[reply]

Looks good. Line 13 uses pairs(args). Shouldn't that be ipairs? Line 14 uses mw.ustring.match(v,'%S'). Plain string.match works for that and is faster (not that the speed would be noticed). Johnuniq (talk) 02:09, 31 March 2022 (UTC)[reply]
@Johnuniq turns out I need both pairs and ipairs to allow it to work if the numbered parameters are non-sequential and to preserved their order. I think the resulting code is a bit less efficient that the non-sandbox version, since there's now an extra loop and a sort operation, but at least it looks cleaner. --Ahecht (TALK
PAGE
) 15:12, 31 March 2022 (UTC)[reply]
@Ahecht That's good but just to be argumentative (hey, this is Wikipedia!) I edited Module:Reply to/sandbox to try the code without skipping nil entries. The only way a nil entry can occur would be if someone purposefully inserts them such as with {{reply to|Jimbo Wales|4=Example}}. That has parameters 1 and 4 with nils for 2 and 3. If someone complained that they used that syntax but Example wasn't pinged, I would tell them to do what the documentation says. However, the overhead of your more thorough code is trivial and if you think coping with skipped parameters is needed, undo my edit and proceed. Johnuniq (talk) 02:05, 1 April 2022 (UTC)[reply]
The use case was that someone could add a bunch of numbered usernames and then decide that they don't want to ping the first one in the list after all. If you allow nil entries, they wouldn't have to renumber. --Ahecht (TALK
PAGE
) 03:51, 6 April 2022 (UTC)[reply]
I don't understand. Say the user writes {{reply to|Example1|Example2|Example3}} and then changes it to {{reply to||Example2|Example3}}. That should work. Unless the module does something very strange, there is no nil. Is the module using Module:Arguments and it inserts nil? There should be parameters to stop that, although a better solution would be to not use Module:Arguments. Johnuniq (talk) 05:25, 6 April 2022 (UTC)[reply]
@Johnuniq It was more the case where the user writes {{reply to|1=Example1|2=Example2|3=Example3|label1=1|label2=2|label3=3}} and wants to delete one, but I guess that's a pretty uncommon situation. --Ahecht (TALK
PAGE
) 13:22, 6 April 2022 (UTC)[reply]
 On hold pending the outcome of Phab:T306735. --Ahecht (TALK
PAGE
) 17:04, 25 April 2022 (UTC)[reply]

The redirect Template:Pin has been listed at redirects for discussion to determine whether its use and function meets the redirect guidelines. Readers of this page are welcome to comment on this redirect at Wikipedia:Redirects for discussion/Log/2023 March 6 § Template:Pin until a consensus is reached. {{ping|ClydeFranklin}} (t/c) 01:36, 6 March 2023 (UTC)[reply]

Remove the colon

[edit]

Should the ":" be removed at default? It's never useful, as most of the ttime the ping goes at the end of a message, and not the beginning. EF5 18:43, 19 December 2024 (UTC)[reply]

Yep I fully agree - I just came to this talk page to suggest the exact same thing (weird timing!). The colon just looks like a mistake, and its the only reason I normally avoid using this otherwise useful template. BugGhost 🦗👻 18:22, 20 December 2024 (UTC)[reply]
EF5: who puts it at the end? Template:Reply to#Single recipient shows to put it at the start. In any case, its use is optional; you can notify users perfectly well using no templates at all, as I did in this post. --Redrose64 🌹 (talk) 23:10, 20 December 2024 (UTC)[reply]
Plenty of people ping at the end of messages, for instance me today a couple of hours ago, which is why I came here. The template being optional also doesn't mean we can't improve it.
Currently:
  • Default only makes sense if placed at start of message
  • To make it not have a colon, you have to add "|p=" at the end, which is not intuitive or easy to remember
If blank was the default:
  • The default template would work in any context, start, end or middle.
  • If you want the existing behaviour of having a colon after the template, you would add a colon after the template, which is very intuitive.
BugGhost 🦗👻 00:07, 21 December 2024 (UTC)[reply]
Who are Plenty of people? Examples please: I've never seen it done this way. --Redrose64 🌹 (talk) 22:57, 21 December 2024 (UTC)[reply]
You've never seen a ping at the end of a message before? Ever? Because here's a comment that does just that, that you replied to 11 minutes before posting this comment. With that out the way can we just get on with improving the template now BugGhost 🦗👻 01:10, 22 December 2024 (UTC)[reply]
They should have written "Also pinging {{u|Example}}." Also pinging Bugghost. Johnuniq (talk) 02:55, 22 December 2024 (UTC)[reply]
I am aware that they could have used {{u}}, but I won't concede that they should have used it. If {{ping}} is not the correct template to use when pinging, then it is misnamed and should be fixed - either by retargetting to a more suitable template, or (as EF5 suggested) by removing the colon. This wasn't a request for explanation about the different ways to mention someone (I am sure EF5 is just as aware as I am about that), just simply trying to improve this template and its aliases. BugGhost 🦗👻 09:49, 22 December 2024 (UTC)[reply]
First, while I may have replied to that post, that reply in no way suggests that I agree with its formatting. Indeed, my posts then and subsequently suggest quite the opposite. I might not even have read that far. Second, the template is not named "ping" it is named "reply to". Template:Ping is a redirect, and a misnamed redirect at that: it does not create a MediaWiki notification (the common understanding of the term) and nor does it test the reachability of a host on an IP network (the original meaning). The template {{Reply to}} does exactly what its name implies: it shows to whom you are replying. That's all. It does not, of itself, create a notification: it is the presence of a link to a user page in combination with other factors that creates the notification. --Redrose64 🌹 (talk) 11:33, 22 December 2024 (UTC)[reply]
I apologise for assuming you read comments you reply to. I also apologise for not realising there was a secret requirement from your blunt Examples please request that any examples posted should also go through a test of whether you personally agree with its formatting. I guess I have come up short and no examples of pings happening at the end of messages will ever be found.
Either way, here's my third consecutive attempt at getting the admins replying here to stop being dismissive and acknowledge the topic's actual question: do you think the colon at the end of this template is serving good purpose? Ignoring alternative methods of pinging, can we make this template more usable by removing the colon? BugGhost 🦗👻 13:30, 22 December 2024 (UTC)[reply]
The {{reply to}} template has had the colon ever since it was created way back in May 2013. As already noted, it is not necessary to use this template for the purposes of WP:MENTIONing a user and so triggering a notification. As Johnuniq has pointed out, the {{u}} template has no colon (it also has no "@" sign) but will serve equally well to notify a user, as I shall demonstrate for you right now, Bugghost. I see no need to alter the {{reply to}} template. --Redrose64 🌹 (talk) 17:57, 22 December 2024 (UTC)[reply]
Use {{u}} if pinging somewhere other than what {{ping}} was designed for. That is, instead of {{ping|Example}} use {{u|Example}}. Johnuniq (talk) 03:21, 21 December 2024 (UTC)[reply]