This wiki is a read-only version of the Stardew Valley Wiki. The official editable wiki maintained by ConcernedApe can be found at stardewvalleywiki.com

Template talk:Price

From Stardew Valley Wiki
Jump to: navigation, search
This talk page is for discussing Template:Price.
  • Sign and date your posts by typing four tildes (~~~~).
  • Put new text below old text.
  • Be polite.
  • Assume good faith.
  • Don't delete discussions.

Sort Order

Nikky jay's recent edits made me realize that using this template in a table column doesn't always result in a correct sort order (see The Stardrop Saloon -- the recipes I recently added to the "Menu" section don't sort properly. The page thinks 1500 is smaller than 120). Is there anything we can do with this template to fix that?
I don't think manually adding a sort index to every page that uses this template is the best option... Also, we don't have access to the jquery file that does the sorting... do we? ???
Thanks -- margotbean (talk) 05:58, 8 January 2017 (UTC)

I updated the template to remove leading zeroes from display, but we still have the basic sort order problem. margotbean (talk) 23:58, 8 January 2017 (UTC)
"I don't think manually adding a sort index to every page that uses this template is the best option. I agree, because it adds unnecessary fluff to values. For sorting, the tables should be specifying data-sort-value or data-sort-type (see mw:Help:Sorting#Specifying a sort key). The MediaWiki version used on this wiki supports data-sort-value. --BryghtShadow (talk) 09:21, 10 January 2017 (UTC)
As an example:
Sortkey With sortkeys Without sortkeys
data-sort-value="300" Gold.png three-hundred Gold.png three-hundred
data-sort-value="0" Gold.png 0 Gold.png 0
data-sort-value="1500" Gold.png 1,500 Gold.png 1,500
data-sort-value="120" Gold.png 120 Gold.png 120
data-sort-value="2" Gold.png 2 Gold.png 2
data-sort-value="2000" Gold.png 2000 Gold.png 2000
--BryghtShadow (talk) 09:31, 10 January 2017 (UTC)
Edit: Wait, I misread what I was agreeing to. What we should do is have a sortable-table-row-formatter template, which handles all the sortkeys. So the Saloon page would look like:
 {{item table header|show=icon,name,description,price}}
 {{item table row|name=Beer|description=Drink in moderation.|price=400}}
 {{item table row|name=Salad|description=A healthy garden salad.|price=220}}
 |}
--BryghtShadow (talk) 09:42, 10 January 2017 (UTC)
This is really awesome! ...But I see you manually adding it to several pages. I didn't want anyone to have to manually add stuff for sorting to work properly. (Don't get me wrong, it's a wonderful template, and I thank you for implementing it!)
I guess we can't override UTF default sorting any other way? Commas will always be less than numbers unless someone does some typing on the wiki? (say, for example, someone adds a new table of items and doesn't know about vendor table format, and doesn't manually add sort-keys, then the table won't sort properly. I think. Right?) margotbean (talk) 01:10, 11 January 2017 (UTC)
Update -- I did some research on the difference between data-sort-type and data-sort-value. You said this wiki supports only data-sort-value, is that right? Because adding "data-sort-type=number" would fix the problem... Of course, anyone creating a new table would have to manually add that to the table. *sigh* margotbean (talk) 01:52, 11 January 2017 (UTC)

Add item names

Now that some items are starting to be added into pricing (rather than just money) we should add the item name into the price tag so people have a reference page to go to. It'd be an easy change

Use
{{name|Qi Gem|{{formatnum:{{{1|}}}}}}}
instead of
[[File:Qi Gem.png|24px|link=]] {{formatnum:{{{1|}}}}}

Then instead of

 Qi Gem.png 40

We get

 Qi Gem.png Qi Gem (40)

At least for Qi Gems, and Golden Walnuts.

People are pretty quick to understand what gold is, as it's introduced really early on, but not necessarily what the other things are if they're just browsing the wiki

TheElm (talk) 18:53, 26 December 2020 (UTC)

The changes you're suggesting don't take into account the cascading changes that would be required in the other 11 languages, so I'm going to say no for now. The issue can be revisited at a later date, when the wiki quiets down a bit, perhaps. margotbean (talk) 19:15, 26 December 2020 (UTC)
If I may say, I like the idea of identifying the multiple currencies. But one of the benefits of the way gold is referenced is that it is so compact. Likewise the Gem icon alone. And once you catch on, you have it. And: how wide will identifying Golden Walnuts be?
What do you think of putting together an introductory paragraph targeted at Stardew newbies and Wiki hellos, laying out the icons and their meanings, using article links, etc? I found myself wondering about the Gems over a couple days as I've wandered through the new material too, but I tend to think it's quicker (and less cumbersome for viewing) just to collect the identifications into one place. It's not that much info to assimilate that we need to repeat it everywhere. Other thoughts? Butterbur (talk) 01:07, 27 December 2020 (UTC)
If the part that causes the translation issue is just the name within the "name" tag, that's got to be readable similar to Template:Description for sure. Might just involve adding the translation text just like that template, though. TheElm (talk) 03:24, 27 December 2020 (UTC)
While that's true, I guess my thinking was to put text in the plain in an article, and let translation be carried from there. And I'm thinking of width constraints in tables where additional lengths in price texts might extend page size beyond constraints. I don't know the answers, but thought I'd offer a possible choice in which direction to go. Butterbur (talk) 04:47, 27 December 2020 (UTC)