Template talk:Gem store table

From Guild Wars 2 Wiki
Jump to navigationJump to search

Template timeout[edit]

The lookahead to group the multipacks, e.g. 125 gems for 1, 450 for 5 and 2,100 for 25, is kinda expensive, also #show'ing the game icon, canonical name, and game description rather than using property chains (e.g. Sells item.Has game icon) costs something. Overall, this is enough to cause a template timeout on Gem Store/unavailable.

I'm not sure how to solve this, one could replace the #show with the property chains, this would barely make it for Gem Store/unavailable, but I guess it may potentially cause a property chain bug (although a first test looked good). Or one could get rid of the grouping and all the #var_final lookahead stuff, however I expect that wiki users are kinda used to this.

Any ideas? --Tolkyria (talk) 19:57, 23 June 2022 (UTC)

The easiest and cheapest lookahead format (in order to group items with different quantities) would be to move the description column to the left next to the item column and merge the quantity and cost column (this way the lookahead would be a simple <br> rather than any complicated #var_final construction that has to fit inbetween the item and the description column). However, I'm not sure if this is an accepted format, see this example:
Item Description Cost
Black Lion Chest Key.png Black Lion Chest Key This key will unlock one Black Lion Chest containing random Gem Store merchandise, including some rare items not sold separately.

Black Lion Chests can be found randomly on enemies or bought from the trading post.

125 Gem
5 for 450 Gem
25 for 2,100 Gem
--Tolkyria (talk) 21:18, 23 June 2022 (UTC)
(Edit conflict) I'm all for simplifying by removing the var_final stuff and having multiple quantities displayed on full separate rows.
Lets try property chains and see if any blanks popup.
Otherwise...
  • Canonical name could go or be replaced by an explode to kill brackets.
  • Description column could be removed.
  • Could substitute the code from Template:Gem into this template to avoid n more template calls.
  • Icons are usually pretty heavy for making pages timeout, we could kill those. -Chieftain AlexUser Chieftain Alex sig.png 21:25, 23 June 2022 (UTC)
Your new column order suggestion makes sense; other vendor list templates present the cost on the right. -Chieftain AlexUser Chieftain Alex sig.png 21:25, 23 June 2022 (UTC)
Turns out that this template was poorly optimised, I removed two redundant style="text-align:left" which helped a bit and also replaced the template {{gem}} with the direct file (note that "bottom:2px" is no longer applied, we might want to readd this after some improvements). For now this was enough to at least get rid of the timeout.
Thanks for your input, I'll try to add some of those later (not today anymore, getting late). Item icons provide an easier identifaction to the wiki users, I would like to keep them as long as possible, the same for the description (although icons are more important). Indeed, on the second thought the description column swap looks quite promising, which would allow us to get rid of all the #var_final stuff, this should definitely buy us some time until ANet will add enough new items to timeout it again. --Tolkyria (talk) 22:11, 23 June 2022 (UTC)
I rewrote the template using your suggestions (except description and icon removal). We are now down to Post-expand include size: 1,287,510/2,097,152 bytes for the largest page Gem Store/unavailable (Gem Store is less than 600,000 right now), which exceeded the limit yesterday after three out of four template calls (four gem store sections).
Changes:
  • Merged cost and quantity column into a single cost column.
  • Swapped description and cost column
  • Due to the two changes above, I was able to turn the lookahead into a simple "suppress row creation and call <br> ''multipack costs''" instead.
  • Using property chains instead of calling them via #show.
  • The template calls File:Gem (cropped).png directly.
  • Removed unnecessary table formatting styles, for example the same width and alignment definitions in each table row.
--Tolkyria (talk) 09:28, 24 June 2022 (UTC)
Nice one. I love easy to read result templates. (now just to convince you guys to use named smw arguments!) -Chieftain AlexUser Chieftain Alex sig.png 15:41, 24 June 2022 (UTC)