Module talk:Message box

From ISCA Wiki
Jump to navigation Jump to search

Template:Permprot

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)

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)

Making a small box with a custom width

I'm interested in making a small message box that's wider than the normal small box (to keep this from going onto three or four lines for pages with longer titles). Is there a way to do this, or could a parameter be introduced to allow for it? {{u|Sdkb}}talk 19:30, 23 April 2020 (UTC)

@Sdkb: See Special:Diff/952939847. It is possible, but making it too wide can cause problems in smaller screens. Ahmadtalk 21:36, 24 April 2020 (UTC)
Have you looked at the documentation for {{Ombox}} or {{Ambox}}? You can set a width using |style=. – Jonesey95 (talk) 21:48, 24 April 2020 (UTC)
@Ahmad252 and Jonesey95: Oops, I was overthinking that by a mile haha. I did look at the {{Ambox}} documentation but wasn't able to figure it out. I'll update it to help those confused in the future. Thanks for the help! {{u|Sdkb}}talk 21:52, 24 April 2020 (UTC)
@Ahmad252 and Jonesey95: sorry for my terrible HTML, but I just spent 15 minutes fiddling with min-content/max-width/etc. and couldn't figure this out: how do I set the box so that it adapts flexibly to the width of the text (so that there's no big margin on the right), and wraps onto a second line only if the reader's screen is too small for it to fit? max-width seems to solve the second part, but I have no clue about the first. {{u|Sdkb}}talk 23:27, 24 April 2020 (UTC)
Unfortunately, I don't know how this can be done. As far as I know, display: inline-block is supposed to do it, but given that there is already a width set in the module's default style, it still sets width to 238px (the default number) unless we can completely remove width. Maybe I'm missing something. Ahmadtalk 00:26, 25 April 2020 (UTC)
@BrandonXLF: this seems like something you might know how to fix? {{u|Sdkb}}talk 20:39, 25 April 2020 (UTC)
Sdkb, do you want it like this? BrandonXLF (talk) 22:57, 25 April 2020 (UTC)
@BrandonXLF: Yes! Thank you as always for your techno-wizardry! {{u|Sdkb}}talk 23:07, 25 April 2020 (UTC)

Talk should not be hidden in small boxes

Lua error in Module:Effective_protection_level at line 63: attempt to index field 'TitleBlacklist' (a nil value). The behavior that using a small box hides the talk link is pretty unintuitive, especially given the convention that many problem boxes (say, {{disputed section}}) are supposed to come with a talk link for discussion of a fix. Please perform the following edits:

  1. Replace <syntaxhighlight lang="text" class="" id="" style="" inline="1">if (self.talk or self.fix) and not self.isSmall then</syntaxhighlight> with <syntaxhighlight lang="text" class="" id="" style="" inline="1">if (self.talk or self.fix) then</syntaxhighlight>.
  2. Replace the block of <syntaxhighlight lang="text" class="" id="" style="" inline="1">if ... end</syntaxhighlight> starting with <syntaxhighlight lang="text" class="" id="" style="" inline="1">if talkTitle and talkTitle.exists then</syntaxhighlight> with the following:<source lang=lua>

if talkTitle and talkTitle.exists then

               local talkText
               if self.isSmall then
                   local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
                   talkText = string.format('(talk)', talkLink)
               else
                   talkText = 'Relevant discussion may be found on'
                   if talkArgIsTalkPage then
                       talkText = string.format(
                           '%s %s.',
                           talkText,
                           talk,
                           talkTitle.prefixedText
                       )
                   else
                       talkText = string.format(
                           '%s the talk page.',
                           talkText,
                           talkTitle.prefixedText,
                           talk
                       )
                   end
               end

self.talk = talkText end </source>

The result should be that a small version of the talk page is generated as a single parenthesized link. Feel free to change it if you feel that's not the best presentation.--Artoria2e5 🌉 05:28, 15 May 2020 (UTC)