User talk:Marble/Sandbox2

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

Need help! For the part

  • Stats-1 to Stats-5

I need a switch / if generated output. Only if something is written into the fields of the template should these be displayed

  • Legacies / Relics area

I need some kind of extra template for the legacies and relics.
Each template should be separate and used with this template. Ideal would be only to enter the name of the legacy / relic and having as an output the stat information accordingly. I guess this will need for each Legacy and Relic to have it´s own page on the wiki. Otherwise all information would need to be entered manually (which would be the less elegant version) :D

Anyone able to help on this ? --Marble 18:44, 8 April 2011 (EDT)

Try replacing
  • | colspan="2" style="color:#00da00;" | {{{Stats-1}}}

with this

  • | colspan="2" style="color:#00da00;" | {{#if: {{{Stats-1}}} | {{{Stats-1}}} | }}
  • |-
  • | colspan="2" style="color:#00da00;" | {{#if: {{{Stats-2}}} | {{{Stats-2}}} | }}
  • |-
  • | colspan="2" style="color:#00da00;" | {{#if: {{{Stats-3}}} | {{{Stats-3}}} | }}
  • |-
  • | colspan="2" style="color:#00da00;" | {{#if: {{{Stats-4}}} | {{{Stats-4}}} | }}
  • |-
  • | colspan="2" style="color:#00da00;" | {{#if: {{{Stats-5}}} | {{{Stats-5}}} | }}

You'll also need to change the bits at the bottom from

  • |stats-4 = 4
  • |stats-5 = 5

to

  • |Stats-4 = 4
  • |Stats-5 = 5

before it will work.Amphoras 09:31, 23 April 2011 (EDT)

Not sure if you want to hide relics if they aren't entered as well. If so, I found a way to do that as well. Its not perfect as it still shows some blank lines, but it hides them to some extend. I modified your code to hide some relics here: http://lotro-wiki.com/index.php/User:Amphoras/Sandbox4 Amphoras 09:59, 23 April 2011 (EDT)
Thankyou for the tips :D I would be happy if you can / want to take over - i have done the ground work that i could - but i can´t get my head around the deeper template programming bits :D --Marble 13:53, 23 April 2011 (EDT)
Glad I could help. I probably don't have time to do much with it just now. Still working on some other things, and got exams for the next month or so as well. What you've done so far is really good, so I'd say keep on going with it and if there's anything you need a hand with just ask :). Amphoras 12:38, 26 April 2011 (EDT)