Template talk:Game update infobox

From Guild Wars 2 Wiki
Jump to navigationJump to search

SMW[edit]

As I already pointed out on the bot page, setting the parameter prev and next is a completely tedious and unnecessary task. For example one could use the following instead:

;Previous
[[Game updates/{{#ask: [[Has context::Game update]][[Has release date::<<{{{date|{{SUBPAGENAME}}}}}]]
| ?Has release date#-F[Y-m-d]
| ?Has release date#-F[F d, Y]
| format = array
| propsep = {{!}}
| sort = Has release date
| headers = hide
| mainlabel = -
| searchlabel = 
| limit = 1
| order = desc
| default = —
}}]]
;Next
[[Game updates/{{#ask: [[Has context::Game update]][[Has release date::>>{{{date|{{SUBPAGENAME}}}}}]]
| ?Has release date#-F[Y-m-d]
| ?Has release date#-F[F d, Y]
| format = array
| propsep = {{!}}
| sort = Has release date
| headers = hide
| mainlabel = -
| searchlabel = 
| limit = 1
| order = asc
| default = —
}}]]

--Tolkyria (talk) 09:34, 11 October 2021 (UTC)

Sorry, I was pretty sloppy there, this code doesn't work at all. The best would be to use a result format. --Tolkyria (talk) 17:15, 11 October 2021 (UTC)
What about setting Has canonical name to F d, Y in each infobox and then asking for the previous/next update with the single printout property ?Has canonical name and the result format [[{{{1|}}}|{{{2|}}}]]. Alternatively, unnamed parameter 2 could be the release date formatted to F d, Y, but this would easily take care of the default cases without any #var definitions and #if checks which happens exactly twice (first and last game update). --Tolkyria (talk) 17:26, 11 October 2021 (UTC)
The code works mostly. Only problem with it is that it tryes to link to Game updates/— if there's no page. But otherwise it's working great.
I like the has canonical name idea. Is it possible to have inline result formats or does that have to be put in an extra template?
I'm not sure i'm following the alternative. If that would be unamed parameter 2 then what is unamed parameter 1? Nightsky (talk) 17:48, 11 October 2021 (UTC)
Nevermind i think i see it now. You mean in the result format and not in this template, don't you? Nightsky (talk) 17:52, 11 October 2021 (UTC)
Yes, it would be in a result format of the query where unnamed parameter 1 is always the query result (without mainlabel=-), here it would be the game update page, e.g. Game update/2021-10-05, so the result format would return [[Game update/2021-10-05|October 5, 2021]].
I'm not aware of a method to produce a link consisting of two parameters (i.e. page name + canonical name) with a single inline query, something like setting the intro/outro to square brackets in the query isn't parsed correctly. So we have to check if the query returns a result before wrapping it outside with square brackets, either
  • #var + #if (current approach),
  • a single #arraymap (can't take care of the default case though) or
  • by returning a default value that is also an exisiting page, e.g. defaulting to Game updates for next on the latest update and prev on the oldest update.
Offtopic, the advantage of the format array is that it's inline and it doesn't add the wierd [[SMW::off]]/[[SMW::on]] tags which custom result formats do; as those sometimes are causing troubles.
Overall these are just minor technical detailts, I definitely like the direction this template is going. --Tolkyria (talk) 19:56, 11 October 2021 (UTC)
Something to consider would be adding a "balance patch" or equivalent parameter which would add the corresponding Category:Balance updates category.
By the way, how do you plan on avoiding transcluding the infobox onto the monthly overview pages? -Chieftain AlexUser Chieftain Alex sig.png 21:30, 11 October 2021 (UTC)
I guess we have to set <noinclude>{{Game update infobox}}</noinclude> at the top instead of setting <noinclude>[[Category:<month> <year> updates]]</noinclude> at the bottom. Or should we completely hide the infobox if for example the SUBPAGENAME does not contain "-" (page name date separator). --Tolkyria (talk) 22:02, 11 October 2021 (UTC)
Yeah I was thinking noincluding the infobox - it's the most straightforward option. -Chieftain AlexUser Chieftain Alex sig.png 22:15, 11 October 2021 (UTC)
I'm not sure how you'd make a #arraymap work here. I'm probably missing something there though.
Using "Game update" as default seems like it would be missleading to me; since it would be neither the previous nor the next update, but the most recent updates instead.
A balance patch parameter is a good call. I'd probably add it as "balance update" to match the name of the category. I should probably add that in already sometime along with the also still to be added handling for April Fools patches; which i'd probably add as "april fools update" - again matching the name of the category - unless the infobox should not be added to the april fools patches.
For transclusion avoidance there would have been noinclude tags around the template added, like it is done with the categories at the moment; like you two are already thinking. I'm still meaning to test weather or not that would cause any problems when added in it's own line or if the follow up text that should be included needs to follow the ending noinclude tag imidiatelly in the same line or if it would otherwise include a new line at the start. Nightsky (talk) 03:34, 12 October 2021 (UTC)
An #arraymap (for one entry) is just an #if where the #if check is also used in the then case (without specifying it a second time and thus avoiding a #var definition in certain cases) and without an else case, i.e. {{#if: {{{1|}}} | {{{1|}}} }} === {{#arraymap: {{{1|}}}|,|@@@|@@@|}}, but that's extremely offtopic now.
Please forget the April Fools game updates, the ~10 pages are going to just clutter up the template code for no reason, compare to ~700 real game updates. They are not related to any downloadable game update itself and hence should not be addressed by this infobox. Just categorize them by hand, an infobox is not required. --Tolkyria (talk) 08:24, 12 October 2021 (UTC)
It's related to how to make the template work so i don't considder it offtopic. It seems helpfull to know about too. Thank you for explaining it.
Ok, i updated the template with a "balance update" parameter and left the April Fools updates out. (Should a template there be desired later it can still be adjusted and added then after all too.) Nightsky (talk) 18:21, 12 October 2021 (UTC)
Do we want zero-padded or non-zero-padded month index as canonical name/infobox header but also in the first section heading? E.g. zero-padded October 05, 2021 versus non-zero-padded October 5, 2021. In the last year we are using non-zero-padded month days in the first header, before there have been phases where the month index was zero-padded interrupted by non-zero-padded phases. --Tolkyria (talk) 07:58, 13 October 2021 (UTC)
I would be in favor of zero-padded dates. Template:Game updates monthly overview currently creates a TOC without zero padding. So I would be in favor of updating that instance too. While the monthly overview is more a manual TOC - should we match both to be more in line of an infobox? —Kvothe (talk) 13:31, 13 October 2021 (UTC)
Well, I would go for non-zero-padded dates instead. I haven't seen a single inline occurrence of e.g. "Prior to the <month> <date>, <year> game update, this ..." where the date was zero-padded. Try the search: insource: "game updates/". The infobox header is the canonical name, why should it be zero-padded there when we are never using it anywhere else in plain text (which is basically the canonical name)?
Also the offical forum post does not zero pad, see e.g. Game Update Notes: October 5, 2021.
I suggested to add the class {{STDT|promo}} to the monthly table on the bot page to match the style of them. --Tolkyria (talk) 15:23, 13 October 2021 (UTC)
For what it's worth; the zero padding currently in place is there because it neatly aligns the numbers for previous and next during the same month; and for consitency i've expanded that to the heading of the template as well. But i can see the appeal of not padded being how dates are generally written too. So.. personally i don't mind either form of date presentation for this. Nightsky (talk) 18:54, 13 October 2021 (UTC)

(Reset indent) I think the best format for the intro would be to put everything in one line:

<noinclude>{{game update infobox}}{{TOCright}}</noinclude>

== Update - October 17, 2021 ==
...

That way the noinclude tags aren't disturbing and don't cause confusion with potential line breaks, futhermore the single line break above the heading is suppressed here. The #arraymap takes care of any surrounding white spaces on the monthly overview page and eliminates them. Set the TOCright only if necessary. --Tolkyria (talk) 18:11, 17 October 2021 (UTC)

I can also add everything in one line. I figured not in one would have been more beneficial for additions since that way additions wouldn't cause a single verry long line at one point. And the toc (in the form as it already is (so with classes if present)) would only be included if it's already on the page. I have no logic for the bot to set it if not already there.
As for the whitespace; i was testing with the following query, imitating the one Game updates:
Text before.
<div class="noexcerpt">
{{#dpl:
| namespace = User
| title = Nightsky/Sandbox/4
| title = Nightsky/Sandbox/5
| ordermethod = title
| order = descending
| format = ,¶²{:%PAGE%}²,
| count = 5
}}
</div>
Text after.
and this produced an empty p element with only a br element in it between the "Text before." and the query if the first heading's not starting in the same line as the ending noinclude tag. So while i can also do the heading in the imidiately following line, that seems like it would produce a space at the start between the text before the query and the query then though. Nightsky (talk) 18:29, 17 October 2021 (UTC)
I've found that
Text before.
<div class="noexcerpt">{{#dpl:
| namespace = User
| title = Nightsky/Sandbox/4
| title = Nightsky/Sandbox/5
| ordermethod = title
| order = descending
| format = ,¶²{:%PAGE%}²,
| count = 5
}}
</div>
Text after.
works fine at the start, even if the heading is in a separate line. So it can be done all in one line at the start if it's changed like this on the Game updates page. However, then the noinclude tag at the end must still start on the same line as the last bit of text, since it unfortunatelly seems that it'll have the empty lines between results otherwise. Nightsky (talk) 18:50, 17 October 2021 (UTC)
The monthly overview transclusion is simply {{#arraymap: {{#var:game updates}} |,|@@@| {{:@@@}} |\n}} which takes care of surrounding line breaks, I'm not sure why it needs to work with #dpl (also you can always play with nowiki tags in #dpl to get rid of at least one extra line break). --Tolkyria (talk) 19:23, 17 October 2021 (UTC)
While it's true that the monthly overviews have it as an arraymap and it thus probably wouldn't be a problem for them, it's currently still using a dpl query on the main game updates page; for which it would be a problem.
And i'm not aware of how to use nowiki tags to get dpl to remove an extra line break so it's missing in my considderation since i don't know how to account for it. All in all i was hoping the following would be possible:
<noinclude>
{{game update infobox
| balance update = y
}}
<toc, if already on the page before>
</noinclude>
<Normal article text content>
<noinclude>
<inter-/intrawiki links>
</noinclude>
So everything in it's own line but dpl doesn't seem to like that as it results in empty lines between results. Where the toc is present on 17/703 pages, inter-/intrawiki links kept at the end as is their usual possition and the game update infobox in multiple lines (if it's a balance update (33/703 pages), otherwise in one line; but still separate from the toc in case there's one) for ease of possible future expansion. Since everything should be in one line though what i'd do now would be:
<noinclude>{{game update infobox|balance update = y}}<toc, if already on the page before></noinclude>
<Normal article text content><noinclude>
<inter-/intrawiki links>
</noinclude>
Am i understanding that correctly? Or how should it be done? Nightsky (talk) 13:57, 18 October 2021 (UTC)
The newlines at the end or front really don't matter at all. You can pass the entire page through {{#if: + | content }} if you want to remove the whitespace. -Chieftain AlexUser Chieftain Alex sig.png 15:22, 18 October 2021 (UTC)
The vertical position of the infobox differs, depending if there is a TOC or not. Hence one can't move through game updates by keeping the mouse cursor on the previous/next link while left-clicking. Any idea how to fix this? --Tolkyria (talk) 17:35, 18 October 2021 (UTC)
Unfortunately i can't seem to figure out why it's displayed differently when there's a normal (not {{TOCright}}) toc on the page as when compared to the other two cases, so i can't suggest much of a solution. Fortunately, Alex will most certainly know of a way to fix it proper. Nightsky (talk) 20:39, 18 October 2021 (UTC)
Seems to be the same amount as the padding of TOCs. —Kvothe (talk) 21:22, 18 October 2021 (UTC)
Fun. So the one with the TOC, appears higher up. My immediate reaction would be to just force the TOC after every infobox. I will have another look at this tomorrow- wasted tonight fixing vector for Wednesday. -Chieftain AlexUser Chieftain Alex sig.png 22:40, 18 October 2021 (UTC)
Float right adjusts its position to the first element on the left, where TOC has a different margin-top than a section heading.
For example Item infobox sets an invisible floating left ".", see this edit from 2012, which is still in use (does this even do anything?). However, I think this introduces a horizontal width, hence the heading is indented by the width of the character. --Tolkyria (talk) 08:33, 19 October 2021 (UTC)
I've never seen an explanation for that stupid floating dot. -Chieftain AlexUser Chieftain Alex sig.png 17:28, 19 October 2021 (UTC)