Template talk:Get Creature Type

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

I created this to address the hundreds of Unknown links that existed on the site.

The problem was simple:

  • Lack of consistency in template usage of added categories.
Primarily due to the 'age' of templates, their ability to handle additional creature types (insects versus beasts, etc..) was lacking. This meant, as documentation of these types were created, the 'hand cut code' for these templates were out of synch and would give back different link types. This addresses that 'find all hand-cut code to deal with this and fix it.'
  • As new categories are added, a simple addition to the types can expose the new types to all existing documents.
  • It reliably returns back a fixed value -OR- Unknown 100% of the time so you can depend upon the input values format for tests (can always test for Unknown cleanly vs lc: and the like)

I thought about extending this template to handle other functions but I figured get it out there to get rid of all the unknown links first.

Additional Functionality thoughts:

  • Add a param (unk=1 or whatever) that will allow it to return back NOTHING instead of Unknown.
To help simplify syntax usage for detection as in : {{#if: {{Get Creature Type|{{{whateverparam}}}|unk=false}}|... versus
{{#ifeq: {{Get Creature Type|{{{whateverparam}}}| Unknown | <then> | <else> ...
  • Add a param (link=1 or whatever) that will have it return back a valid link to Creature type instead of text -OR- Unknown, as text, if the creature type is unknown.

Again, just a couple thoughts on it. After a bit of work, I did get rid of all the old unknown and Unknown bad links by putting this together...

--Eleazaros 19:46, 3 January 2008 (PST)