User:Magill/Sandbox-template testing

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


From Template_talk:Item_Tooltip#Undocumented.2Fincomplete_changes...

My actual understanding of tooltip templates

Actually, our templates Template:Item Tooltip, Template:Effect, Template:Skill & Template:Trait are all using a 2nd template Template:Tooltip which uses a 3rd template Template:Icon.

Parameters mode={{{mode|}}}, arg={{{arg|}}} & amount={{{amount|}}} seem only there to "pass" the parameter to the 2nd template Tooltip.

  • Item Tooltip uses all 3, arg to optionally override name, considered by template Tooltip (rename doesn't seem used, could be removed in template)
    • Template:Reward is a shortcut to not use prefix "Item:" but ends calling an item page, it uses arg, rename or plural to be passed as arg and uses by default "mode=imlink_plain"; if Item Tooltip was using imlink_plain instead of imlink by default (2nd line of template) and if we don't mind using as example {{:Item:Silver Token of the Wilds}} instead of {{Reward|Silver Token of the Wilds}}, Reward could be considered obsolete
    • Template:Barter is not calling any template or item page so that's why it lacks the ability to fetch the proper icon, but this allows to place the text as needed; if the float option would be directly in template Tooltip, Barter could be considered obsolete
  • Templates Effect, Skill & Trait are all
    • not using amount, that's OK not needed
    • using mode, still useful to control the look of the link
    • using rename, but I don't think of any situation where the text should be renamed for an effect, skill or trait, so those templates could be modified to remove this line
| rename       = {{{arg|{{{rename|}}}}}}
and change
| name         = {{#if:{{{arg|{{{rename|}}}}}}|{{{arg|{{{rename|}}}}}}|{{{name}}}}}
to pass the parameter as is
| name         = {{{name}}}
and remove this line in /doc pages, not used anyway in template
| arg={{{arg|}}}         Leave as is

-- Goingbald (talk) 02:37, 15 August 2013 (EDT)

From what I remember, this seems right. The reason for the arg/rename thing is that originally, arg was there to change various things as necessary. It ended up that the only thing it was really used for was renaming stuff. So in some places rename was used instead.
There's so much half finished stuff going on with templates. The plan was to re-write how a lot of stuff worked, eg. using separate templates for different item types to cut down on the number of unused parameters all over the place. I actually created several of the new templates, but they were never put into use. I think the amount of work it would have taken to convert everything and make sure nothing broke was just too much, and people got busy with other stuff and it kindof fell away. I'm sure there was a load of stuff with traits, and auto-updating tables (currently if a trait changes, you need to make edits on several pages) I was working on to make things easier to maintain, but again it was a lot of work to get it going. Most of it was on the test wiki, and I think I saved it in various pages in my userspace as well if anyone is interested.
In summary, there's lots of stuff that was planned/started but wasn't quite finished, so we still see bits of it around that aren't being used properly yet. Amphoras (talkTalk to me!) 16:51, 18 August 2013 (EDT)

tests

 foobar {{:Item:Minstrel's Friend|mode=imlink_plain|arg=foobar}}

3 foobar {{:Item:Minstrel's Friend|mode=imlink_plain|arg=foobar|amount=3}}


3  foobar {{:Item:Minstrel's Friend|mode=imlink|arg=foobar|amount=3}}

foobar {{:Item:Minstrel's Friend|mode=link|arg=foobar}}

5 {{:Item:Minstrel's Friend|mode=icon|arg=foobar|amount=5}}

  • all work, but not

 Minstrel's Friend {{:Item:Minstrel's Friend|mode=imlink_plain|rename=foobar}}


foobar

{{:Item:Minstrel's Friend|arg=foobar}} has a very interesting effect!


Item:Old Chest (the Dale-lands)