Thread:Karuberu/@comment-195370-20180225140318

Well this was a nice surprise. Something I'd been trying to do for a year or so suddenly fell into place after Desz got me thinking and also because Tooltips now work in a certain way (or I just realised they could be used that way).

Turns out it was very easy and elegant code!

So I finally picked up my crafting tools to bring my Clothcraft back up to cap, and create the necessary pages to do so. In making Category:Clothcraft/Expert, I've made a couple of new templates:
 * I: 'I' for 'Iconned Item' or somesuch. I wanted to keep the title brief, as I envisage it being used often in summary lists.
 * In: 'In' for 'Inline Iconned Item'. Again, a brief title.

I uses #dpl to automatically apply the 32x32 icon infront of an Item Article link, as long as the icon id is declared in Item Statistics. It then uses #lst to create a mouseover tootlip of the Item Image section (it could use #dpl instead if the Item Image was within Item Statistics, but I gather we've just spent the last couple of years moving the Item Image outside of that template! It would work either way.

In does the same, but with a 16x16 icon, and hence is useful for when items are in sub-lists (like recipe ingredient lists).

I think I'm going to add a |noicon parameter, so that the templates can be used for the mouseover tooltip without the icon if needs be. Any other comments or observations would be appreciated. Not sure if it would be appropriate or even possible to roll this out site-wide via automation. 