Template talk:Approved image

Fixing
Cudos to Bioexpander for making this, since it's a very useful template. I'm just going to point out some things I had to fix, as perhaps an opportunity for learning.


 * Using tables

As a general rule of thumb, there is no need to use a table in your template unless you have a lot of information to display side by side in rows. In the case of this template, there was only one cell of information per row, so a table was unnecessary. Using a few s is much simpler and more efficient.


 * Junk styles code

There were some broken style definitions. For instance, margin:0; and margin-top:1px; affect the same thing, so it could have been simplified to margin:1px 0 0 0;. Another example was the repeated use of border:0px padding: 1em 1em 1em 1em; - this bit never had an effect because of the missing ; before the padding declaration, so I just removed it. Also, the use of in the s within each table cell was unnecessary. Adding text-align:center; to the style of the table itself would have done the same thing and prevented redundancy.


 * Use if #if and #switch parser functions


 * 1) if functions are used to define what happens in the case that a parameter is empty or full. #switch functions are used to define what happens in the cases of many different parameter values, which could include an empty value. You don't need to use both a #switch function and an #if function at the same time.


 * Call for a missing parameter

This template was looking for the value of a parameter named and then returning a different value if it was empty. This template is mainly used in the Template:Audio Diary File, but that template doesn't have a parameter in it, so this meant it was returning an empty value on every single page it was used on, until Bioexpander started adding a source parameter of seeming gibberish to each file page. This also wasn't designed with a way to handle audio files from Cult of Rapture which don't have a source file location in the actual games.

~Gardimuer   { ʈalk } 21:25, February 2, 2014 (UTC)