Module talk:Message box

Jump to navigation Jump to search

July 2019: When and how vs. how and when (edit request)

Moved from Template talk:Ambox

The current text of the last sentence of the template reads "Learn how and when to remove this template message." I propose switching the "how" and the "when", giving us "Learn when and how to remove this template message."

It not only sounds cleaner but also has more usage. Thoughts?

CampWood (talk) 18:00, 16 December 2018 (UTC)

Bumping thread. CampWood (talk) 23:04, 3 January 2019 (UTC) CampWood (talk) 23:04, 3 January 2019 (UTC)

Bumping thread. CampWood (talk) 17:47, 17 January 2019 (UTC)

@CampWood: I moved this to a better forum and added the request template to attract editors. — xaosflux Talk 18:33, 17 January 2019 (UTC)
Seems reasonable (the current text seems rather awkward); if there is no objection I'll do it in a couple of days. Galobtter (pingó mió) 17:29, 18 January 2019 (UTC)
I dunno, what's so awkward about it? It seems fine to me. I'm curious where the more usage comes from; google turns up 7.6M results for "learn how and when" but only 240k for "learn when and how". Likewise, I get 71.2M results for just "how and when" over 55.4M for "when and how". Not an exact science, to be sure, but that suggests to me that the current language is the more common. ~ Amory (utc) 01:52, 19 January 2019 (UTC)
@Amory:: Huh, I get 75.5M results for "how and when" and 105M for "when and how". CampWood (talk) 15:01, 8 August 2019 (UTC)
Not done @CampWood: please establish a consensus for the change here, then reactivate the edit request if warranted. — xaosflux Talk 19:33, 22 January 2019 (UTC)

All right. The phrase "when and how" is not only more natural than its reciprocal (if you will), it's also more common. It doesn't matter how you do something unless you know that you want to do it! In other words, you'd want to find out when to do something before you find out how to do it; the word order should reflect that. So, who's with me? Let's establish some consensus!

CampWood (talk) 15:16, 8 August 2019 (UTC)

Protected edit request on 18 December 2018

Add a class named "box-Template_name" to the table element of every ambox (or for good measure, every box).

This would help automated tools like Twinkle to efficiently identify the template being used (parsing the page wikitext for this is not reliable, because of the usages of template redirects). This would be used in Twinkle for implementing an untag feature - making the tag module able to add and remove tags as well.

For many of the tag templates, a class with name roughly of the form "ambox-Template_name" already exists, but they are not consistent across all templates: in some cases, the first char of the name is lowercase while in others it's uppercase; in some, the names don't match the template name such as in {{improve categories}} and {{more citations needed}}; in several others, there is no such class at all. It makes much more sense to get this class added centrally.

It need not necessarily be a class, some HTML(5) attribute could be used too.

SD0001 (talk) 18:52, 18 December 2018 (UTC)

Not done @SD0001: this section can certainly be discussed what to do, however I've deactivated the edit request as there is nothing actually ready to be done. Feel free to work on this in Module:Message_box/sandbox and once it is ready to go and has appropriate support reactivate the edit request. — xaosflux Talk 19:03, 18 December 2018 (UTC)
@Xaosflux: Haven't I made it more or less clear what is to be done? I think this would be fairly trivial to do for template editors familiar with the module. SD0001 (talk) 19:10, 18 December 2018 (UTC)
Once someone does it in the sandbox, and it is ready for anyone to implement go ahead and reactivate the edit request. The edit request queue is a check against the protection policy - so that improvements can be made even when a page is protected. I'm not suggesting this discussion stop happening, it is fine to ask for someone to do something for you and anyone is welcome to sandbox this, they don't need any special user groups for the next step. — xaosflux Talk 19:23, 18 December 2018 (UTC)

Alright, done in the sandbox. Please incorporate. SD0001 (talk) 15:58, 19 December 2018 (UTC)

To clarify: since this utilizes the |name= argument, the class would only be added to boxes that specify a |name=. This was done because it seems impossible to get the actual template page name, as mw.getCurrentFrame():getParent():getTitle() gives the metatemplate name (Template:Ambox), not the template name, and getParent() can only be called from the current frame. I guess this is why the |name= field exists in the first place. SD0001 (talk) 06:16, 20 December 2018 (UTC)
@SD0001: Sorry to be a pain, but can you confirm you have tested this change and it works as intended? I appreciate it is a trivial change but this is a widely used template I would not want to make any unnecessary changes. Thanks — Martin (MSGJ · talk) 09:07, 21 December 2018 (UTC)
@MSGJ: Yes. See User:SD0001/sandbox2. It works with all box types. SD0001 (talk) 09:09, 21 December 2018 (UTC)
 Done — Martin (MSGJ · talk) 10:26, 21 December 2018 (UTC)

Translating this module

How can I translate this module to another wiki? I'm planning to allow parameters in English as well as in another language. Can someone help me? --CaiusSPQR (talk) 18:07, 30 January 2019 (UTC)

Edit request 13 February 2019

Please copy over the contents of Module:Message box/sandbox. I have made an edit there which implements the demospace feature documented at Template:Mbox. Testcases can be found at its testcases page: Template:Mbox/testcases. Danski454 (talk) 20:04, 13 February 2019 (UTC)

A little more background please. Is this feature currently not working? Did it previously work and you are fixing it? — Martin (MSGJ · talk) 14:38, 15 February 2019 (UTC)
@MSGJ: The demospace parameter was removed from the module by Mr. Stradivarius in a sandbox edit in July 2014, which was copied over with several other changes in November 2014. I cannot find any further explanation for the changes, but the feature still appears in the documentation of {{mbox}} and is used by the documentation of templates like {{notice}}. The proposed edits readd the parameter. Danski454 (talk) 17:03, 15 February 2019 (UTC)
I can't remember why I removed it from the sandbox. I suppose it must have made sense at the time, but it looks like it deployed either by accident or without any discussion, so I'm fine with reinstating it. I wonder how many places still use it? — Mr. Stradivarius ♪ talk ♪ 14:30, 16 February 2019 (UTC)
No further comments so  Done — Martin (MSGJ · talk) 20:36, 28 February 2019 (UTC)
The article is a derivative under the Creative Commons Attribution-ShareAlike License. A link to the original article can be found here and attribution parties here. By using this site, you agree to the Terms of Use. Gpedia Ⓡ is a registered trademark of the Cyberajah Pty Ltd.