User blog:Blupo/The Market, Recoded

Whether you like it or not, the Market page is very popular, only beaten in view count by the Drops page. Editing the page is a bit of giant mess. Try to use the VisualEditor to edit it and you get this:

 BladeofGrassicon.png|5k|link=Blade of Grass Skydustericon.png|50k - 60k|link=Skyprince Advocateicon.png|2k|link=Advocate ShizenKatanaicon.png|500|link=Shizen Katana Katana4.png|750|link=Spirit of Suma MetallicRapiericon.png|8k|link=Metallic Rapier Darkhearticon.png|5k|link=Darkheart Crafter'sOutfiticon.png|5M - 10M|link=Crafter's Outfit WolfLeatherArmoricon.png|6k|link=Wolf Leather Armor DecayingShroudicon.png|5k|link=Decaying Shroud CoatofTwilighticon.png|15k|link=Coat of Twilight

Editing in Source mode doesn't help either; now it's a giant mess but with monospaced font.

BladeofGrassicon.png|5k|link=Blade of Grass Skydustericon.png|50k - 60k|link=Skyprince Advocateicon.png|2k|link=Advocate ShizenKatanaicon.png|500|link=Shizen Katana Katana4.png|750|link=Spirit of Suma MetallicRapiericon.png|8k|link=Metallic Rapier Darkhearticon.png|5k|link=Darkheart Crafter'sOutfiticon.png|5M - 10M|link=Crafter's Outfit WolfLeatherArmoricon.png|6k|link=Wolf Leather Armor DecayingShroudicon.png|5k|link=Decaying Shroud CoatofTwilighticon.png|15k|link=Coat of Twilight

You may be wondering why this giant mess is part of the Market page anyway. Surely there is a better way. Well actually, no, there isn't. We use decided to use galleries for the presentation since they were the most aesthetically pleasing option for both mobile and desktop. Anything else would look like a giant mess on either instead of having a giant mess of code behind both. But just because we have to use galleries doesn't mean that we can't find ways to make editing it easier.

Focus on the Prices Today I would like to introduce you to the Market recode. It's the same Market page, but editing is focused on the prices, not the layout. In the [ VisualEditor], clicking on the gallery will present you with the entire list of items where you can chnage each price individually. Plus, with the search bar, you can quickly find and change the price of any item.

In source editing, you simply need to add a line to the template:
 * ItemName = ItemPrice

If the item already exists, you can just change the price.

Technical Details The recoded Market page takes advantage of how Templates work. Behind User:Blupo/MarketRecode (the concept page) is User:Blupo/MarketRecode/Prices. This page is essentially a clone of the current Market page, but all of the prices are replaced with variables, so that it can be included onto a different page. When transcluded onto another page, you only need to fill in the variables that change the prices, and the rest of the page is shown without having to actually write out its code.

Striking a Balance Ther is a big caveat to making it easier for people to edit the prices. The transcluded page (the one with the actual Market layout) is near impossible to edit with the VisualEditor. The galleries have been recoded to use the  parser function so that templates can be used with them. Using source editing is the only way to be able to edit the transcluded page. All galleries look like this now:

If you looked at the code closely enough, you'd see that there is another template used for the galleries, User:Blupo/MarketRecode/GalleryItem. This is an automation template that does all of the work of adding a gallery image without having to type out all of it's ugly code. If you use the source editor, there will be instructions on how to actually add galleries and gallery items:

Consensus What do you think? Do you like this recoded Market page? Most people don't have any reason to edit the page's layout, but is the tradeoff worth it? Please leave your comments and/or suggestions.