Template talk:Worth

From Lotro-Wiki.com
Jump to navigation Jump to search

this template could be adopted even further to include destiny points... --Xander 02:51, 8 April 2007 (PDT)\

Should this be extended to include experience points - for quests? Synique 02:40, 2 July 2007 (PDT)


Latest Changes

I forgot to put in latest comment, but now the "Destiny Points" & "Turbine Point" icons are now clickable to open the respective pages. --Goingbald 00:23, 18 January 2011 (EST)

Forced Spacing Causes Problems

I've noticed that using this template causes a break ("enter") to appear right after it. This messes up some skill pages that still use this template instead of the Training price template and trait articles like Captain Traits. Is there anything possible to solve this, or should these pages just not use the worth template? --Ravanel (talk) 10:46, 15 March 2012 (EDT)

Every line break in that the template appears to be inside an html comment, which should prevent them from getting passed out. I edited it again to remove two newlines which should not be passed through, but… who knows.
See if my latest change has made a difference. RingTailCat (talk) 11:29, 15 March 2012 (EDT)
I sat staring at that code yesterday but must have been too tired to see the obvious, that includeonly ≠ onlyinclude when it comes to what is included and what not. Silly me. Perhaps we should entirely stop using noinclude at templates and only use onlyinclude to make it utterly clear what is included or not? Zimoon 14:43, 15 March 2012 (EDT)

Aligning questions

This template displays exactly what it is asked to display. On many pages that is perfect. However, in vendor tables together with right-aligning the outcome is often less attractive. I wonder if there is an interest in adding padding, and how that could be best done?

Today a vendor list may look like (the item and prices are ofc bogus):

Item Cost
 Steel Blade 2 Silver 2 Copper 
 Steel Blade 22 Silver 22 Copper 
 Steel Blade Gold 222 Silver 22 Copper 
 Steel Blade 2 Silver 
 Steel Blade Gold 22 Silver 
 Steel Blade Gold 
 Steel Blade Gold 2 Copper 

Notice that the right-alignment does not play well with the coins. And neither with the number of digits. The value is accurate, indeed, but not neat nor easily read.

Question is: Should we consider adding a parameter for padding?
If set it either pads with white-spaces with or without the coin icons.

I know this is a tricky field and we cannot expect to get it perfect, but perhaps somewhat better. The readability value is not that high, but definitely not negligible. The neat-factor is a lot higher and IMHO something good-looking attracts readers and they will return; actually, science has proven that people trust good-looking "something" better than not-good-looking (and you don't even have to go as far as to ugly-looking). Still the neat-factor weighs a lot less than complete and accurate content!
Zimoon 06:04, 27 July 2012 (EDT)

I agree that it's a little "ragged" looking on tables with different worth amounts scattered about. Some suggestions below:
(Current look)
Item Cost
 Steel Blade 2 Silver 2 Copper 
 Steel Blade Gold 
Here, we have the issue of gold coins (without lower denominations) appearing further to the right of silver. By itself, Gold  is easy to read, but it looks odd next to the 2 Silver 2 Copper . The obvious solution is to force appearance of all lower denomination coins, which would look like this:
(Display all coins)
Item Cost
 Steel Blade 2 Silver 2 Copper 
 Steel Blade Gold 0 Silver 0 Copper 
To me, this is a small step back in terms of readability, since it adds more numbers for the reader to process, but it's certainly very neat and tidy looking. The other issue is with different number of digits across table rows, like this:
(Current look)
Item Cost
 Steel Blade Gold 222 Silver 22 Copper 
 Steel Blade Gold 2 Silver 2 Copper 
Since there's no way for a template on one row to know what's in the template of other rows (that I know of?), the default solution is to force all fields to pad to the maximum possible width for that field - three digits for silver, two for copper. This might look like this:
(Padded values)
Item Cost
 Steel Blade Gold 222 Silver 22 Copper 
 Steel Blade Gold __2 Silver _Copper 
Actually, those came out nicer than I'd expected. Coding this in would definitely be possible if a design could be agreed upon. Thoughts? Sethladan 12:18, 27 July 2012 (EDT)
I completely agree that 0-oes just add more processing to the reader (and drains some brain energy, if we happen to have some left). Rather white spaces and the icon. Yes, that looks nice. And you are right, the only way to know of other wows is to have everything in a table where price would have multiple columns. That is doable, but I guess awkward and the editor must know what is going on under the hood and add colwidth here and there. Hence I think "keep it simple stupid" works here too -- not directed to anybody ;)
I leave the arguing to you guys. I am just happy to be here. -- Zimoon 05:51, 28 July 2012 (EDT)
Hehe, I wasn't arguing, just analyzing - I agreed with you that there is improvement to make. I guess I am thinking like a programmer: Tell me the design you like and I'll do it. :-P Here's a whitespace example instead of the zeroes, no colspan or width required:
(Forcing icon appearance without zero)
Item Cost
 Steel Blade Gold 222 Silver 22 Copper 
 Steel Blade Gold ___ Silver __ Copper 
 Steel Blade 2 Silver __ Copper 
I totally agree about "keeping it simple," as well. I always like to design templates that require minimal work from whoever uses the template - that's the point, after all, to let editors focus on content and move on quickly. Sethladan 13:00, 28 July 2012 (EDT)
I was more of thinking "others may chime in and say something". I think the last example looks neat and ... brilliant. One can argue that the icons add no info, but what would be the alternative?? Anybody bothers? woohoo ;)
Zimoon 20:25, 28 July 2012 (EDT)
Seth, have you pondered, contemplated, and meditated over this during your intense studies? I just happened to see Durstan and shrugged a bit ;P -- Zimoon 14:29, 20 December 2012 (EST)
Heh, I forgot about this discussion. Seems like no one ever argued against. The only thing new that I would add is that whatever alignment "fix" we work out should (probably?) only apply when inside a table - because there's no reason for the extra icons if I just want to say I only have Copper . I can think of two ways off the top of my head that this might be done. Sethladan 04:45, 21 December 2012 (EST)
No idea if you can do it with parser function or not, so I won't meddle in that, but it can definitely be done very easily in css. Just make it always show the 3 in here, adding a specific class to each, and then tell them to show or not depending on being in a table or not in css later (might need some additional parser functions for changing the class).
Just an idea :P
Gwenwyfar (talk) 19:53, 21 December 2012 (EST)
You basically just summed up the two methods I was thinking of, Gwen, heh: checking for class and/or checking for inside a table. Sounds like I have another job to do in addition to cleaning up that altRows code. Thanks for the endorsement that it can be done! Sethladan 23:42, 21 December 2012 (EST)
And I totally agree, empty coins only make sense within tables. -- Zimoon 06:41, 22 December 2012 (EST)
Heh :P
I could do it if you're still busy.
Gwenwyfar (talk) 17:44, 22 December 2012 (EST)
If you'd like to, Gwen, go for it. :) My Minstrel is in the mid-60s now and I'm doing Enedwaith quests for the first time, so I'm having altogether too much fun in-game for much time with template tinkering, heh. Sethladan 22:56, 22 December 2012 (EST)
Hahaha, ok, I'll see if I can make it work then :)
Gwenwyfar (talk) 23:52, 22 December 2012 (EST)
There you go, can see it working here. Made it so when no value is entered, it shows a coin anyways, with the empty space, and a special class, which won't display anywhere but on tables. Let me know if there are any issues.
Edit: Hmm, it is working on the above tables now, it looks a bit odd when there is no value for gold but silver is showing up. Maybe we should make something more complex that shows only the first to last starting at the highest value coin with a number? Like, if silver has a value gold doesn't show, and if only copper has a value only it shows?
Edit2: When only gold and copper shows it looks confusing too, it takes some processing to notice that the second value is for copper, and not for silver. Maybe that can be fixed with spacing, but perhaps adding a 0 might be a better option...
Edit3: Alternatively, we could also simply not show anything at all. Just have an empty space large enough so that the coins are always on the same line.
Gwenwyfar (talk) 00:23, 23 December 2012 (EST)

Okay, flush left again. Rargh, found a possible major caveat to this new feature: Quest rewards are all in tables, and other stuff besides coins are used with Worth. See Quest:The Grey King for some not-quite-what-we-expected behavior. Sethladan 01:42, 23 December 2012 (EST)

Also, and this is where the parser functions come in, I guess, the rows are still a little ragged depending on if numbers entered are 1, 2, or 3 digits wide. Now I'm glad I didn't take on this job. :: big innocent face :: :D Sethladan 01:45, 23 December 2012 (EST)

Please, revert recent changes to Template:Worth, something is seriously wrong with it. I believe what is wrong is that too many left-hand coins are displayed. If the price is in TP, no coins G, S, or Cu, should be visible. If the price is in G and/or S and/or C then TP should not display. If the price is in S and/or C then G should not display. Right now all tables with Worth are broken, displaying all of G, S, C, and TP. That breaks column widths for all of the tables. I will not revert though, as I do not know if there was something done "under the hood" or if the error is in diff or elsewhere.
Before any further attempt, please test it carefully. Preferably at the test-wiki. -- Zimoon 07:27, 23 December 2012 (EST)
PS: Have a look at an item-page. Now Vendor, Worth, and Lotro Store shows up also when there are no values for them. I am pretty sure they did not do that yesterday ;) -- Zimoon 07:32, 23 December 2012 (EST)
The latest change broke every quest reward section:
Rewards
RingTailCat (talk) 09:37, 23 December 2012 (EST)
Wanted you guys to see it before reverting. And I didn't see what happened with quests, but they are a different kind of table, so it can be specified more for altrow-tables only and those won't be messed with (as long as there isn't any other altrow table out there that could be affected... Then we'd need a specific class for those we want only).
Problems with coins showing when they shouldn't show at all aside, I still don't know how we can fix the coins issue itself... Even if gold and silver does not show when one of both are not the highest value, what about gold-and copper situation? It requires more attention to see that the value is for copper than if we had a 0 instead of white space. Also, nobody said what they think of leaving a white space instead of coins showing at all :P Personally, I think it will probably be the best option for making all cases show decently, while not needing a huge amount of ifs for every specific situation.
Gwenwyfar (talk) 11:53, 23 December 2012 (EST)
Yeah, I totally didn't foresee the issue with quest tables, either. Partly because they really shouldn't be tables, they should just be container boxes that open and shut. But, of course, I never got around to coding a better alternative. Thanks for giving it a try, though - you have more courage than I. :) And whitespace instead of an "empty" coin image sounds like a good possibility, actually. Can you come up with an example and post it here so we can compare with the tables above? Sethladan 12:12, 23 December 2012 (EST)
It was not only quests but all sorts of tables: quests, items, sell-tables at NPCs, Lotro Store, etc. Actually, the problem is what I lined up above, in the 07:27, 23 December 2012 (EST) post, too much was visible and that broke the tables. Good try though, and better luck next time :-) -- Zimoon 16:46, 23 December 2012 (EST)
Oh, that was rather easy to fix, had forgotten ifs can contain multiple selectors. Coins no longer show up when they are not called for, you can see it on the destiny points here. Now just need to find a solution for the visual aspect. Going to fix everything with what we have now, then I post an example of that other suggestion, so we can compare ;)
Gwenwyfar (talk) 19:27, 24 December 2012 (EST)
You can see both examples here. Only issue is neither are completely aligned because of differences in values spacing (2 numbers vs one number), which I was thinking in leaving them inside a table to fix that, unless anyone has a better idea. It doesn't bother too much when all coins show, but for leaving a blank space that is important. I also added an extra space between coins and numbers, which improves the readability a bit, in special with the gold and copper coins only issue.
Gwenwyfar (talk) 19:45, 24 December 2012 (EST)
Much better :)
I was also thinking about that alignment and what to do about it. The easiest is to ignore it and just add a few white spaces (or hidden underscores). The harder is to make it look neat for whatever values you throw at it (probably some hidden table), but that also calls for a lot more white space than perhaps is justifiable in some tables where there is gold on just a few rows, such as reputation reward tables. Something in between would be to let the editor decide: one way would be to replace "leading zeroes" with hidden underscores in the display (095 ↔ _95) and if the editor does not add a zero the value is displayed as is; another way is a parameter which toggles on fancy-view and the latter pads with the given number of white-spaces (2 or 3) for that usage-location.
I pass on this one. My gut feelings say that with too much white space we have a lot of cleaning up to do, finding visually broken tables and fix those. We have waaaaaaaaaaaaaaaaaaaaaaaaay too many tables with fix column widths, which are fragile and break for these things. My eyes and my experience from usability is that we should go for lined up things, which requires much white space. The pragmatic me says we provide the options but editors add them over time. So I pass.
Right now items display Vendor, Worth, and Lotro Store only if there is something to display. That is, if the worth templates are empty they do not display that row in the items view. That is something that must be tested before eventually committing any changes.
-- Zimoon 05:53, 25 December 2012 (EST)
The problem with whitespaces is that it will never be right because of variations. Well, if there are any tables out there with fixed width exactly as needed and not many values as the template is now, it will probably be broken with or without a hidden table since it will always show 3 coins space. (I've yet to see what is the default space on those tables, though, could you give some samples?)
At least silver and copper have a fixed max value, so we only need enough space for that, gold is on the corner so it doesn't bother. I'm going to see how a invisible table (which seems like the easier to do, with hopefully good enough results :P) looks like later and how much space it actually takes.
That probably has to do with spacing, so that likely won't be an issue, but I'll give a look once its done ;) (Kinda off-topic, but I never really thought of using comments in middle to create spacing and organization like we do here, its kinda nice to be able to add space without actually adding space, all the templates I did myself when learning were huge blocks of text, heh)
Gwenwyfar (talk) 08:58, 25 December 2012 (EST)
Just finished the aligning. And gave a look at some vendor tables, most of them will do just fine, but yeah, with or without the invisible table/extra spacing, some like Rûsu are gonna break. All the silver-and-copper values will look ok since gold disappears, but where the gold shows it will look bad. Unfortunately there's no way to avoid this with the way we want to change the template.
The visual aspect of the template is done, though, just need to check some things and we can use it. (Samples here)
Gwenwyfar (talk) 18:04, 25 December 2012 (EST)