Lots GD rebuild: good way to do?

Fragment of a discussion from User talk:Zoycite
Jump to: navigation, search

Thanks for the tip. works on the item page, but not on the shoptable.


LotS/Power_Bonus_(2)   works well with |image=Power Bonus

but the table is still looking for the default image.

Simon (talk)15:01, 9 September 2013

typically what we do when we want to make a row in a table do something different than default is add a template parameter (positional or named you decide).

So you have the following now:

{{LotS/DomeShopRow|Galaxydome Passes}}
{{LotS/DomeShopRow|5 GD Passes}}
{{LotS/DomeShopRow|Attack and Defense Increase (1)}}
{{LotS/DomeShopRow|Attack and Defense Increase (2)}}
{{LotS/DomeShopRow|5 GD Passes(2)}}

what you should do is alter the template, Template:LotS/DomeShopRow so that you can do something like this:

{{LotS/DomeShopRow|Galaxydome Passes}}
{{LotS/DomeShopRow|5 GD Passes|alt_image=LotS GD Pass.png}}
{{LotS/DomeShopRow|Attack and Defense Increase (1)|alt_image=LotS AD Increase.png}}
{{LotS/DomeShopRow|Attack and Defense Increase (2)|alt_image=LotS AD Increase.png}}
{{LotS/DomeShopRow|5 GD Passes(2)|alt_image=LotS GD Pass.png}}

then in your template check for the existence of that variable. if positional (usually what we do), use 2; otherwise use the name. I am using the variable name alt_image for clarity.

{{#if: {{{alt_image|}}}|
no image / default normal behavior

hope this helps clarify.

This has been kept as general as possible to leave room for figuring out what you think will work best. if you still have problems I can try to assist some more. Obviously you can choose what to do and have a good idea of what templates already do, so just keep doing things that way :)

also I think some of the LoH pages have some form of the above procedure for when a card is duplicated such as Mighty Blow and Splash Damage, since they have enemy versions and player versions. So the wiki get 2 cards input into it as a result, but name alone won't work so the wiki has to resolve the display name somehow. This is relevant in the item row pages on LoH/Genesis/Event, as you can see in this page splash damage displays the correct name instead of the article name.

Zoycite (talk)16:33, 9 September 2013