STO Awakening.jpg

Template talk:Traiticon

From Star Trek Online Wiki
Jump to: navigation, search

Possible Errors[edit source]

While I was going through trying to make sure Dominion icons were showing up where they were supposed to, I discovered that this template doesn't seem to like to display the images it's being called to all of the time. Case in point, Ability: Beams: Overload, if you correct the incorrectly inserted mastery trait icons, it ends up not displaying Heavy Tachyon Mine icon.png Heavy Tachyon Mine's icon, nor Preferential Targeting icon.png Preferential Targeting's. I've taken a cursory glance at the relatively simple template, and the traits themselves, and everything seems to be in order, but the images do not seem to load... Hopefully it's not just me?--LordTrekie (talk) 05:00, 18 June 2018 (UTC)

Issue is with how the starship trait icons were named. {{traiticon}} template requires File:<Name> icon.png, while most ship trait icons are uploaded in different format - File:Mastery trait <name>.png because it is {{StarshipMastery}} template requirement. So from now on, lets use {{starshiptraiticon}}:
No icon.png
for starship trait icons. There are still cases where starship traits will use Traiticon because ship is not their source (lockbox, specialization, etc). --Damixon (talk) 11:31, 18 June 2018 (UTC)
If that's the case (there being the possibility of a ship trait not coming from a ship), why not instead add a conditional check to this template, looking for a {{StarshipMastery}} formatted file name, then falling back to what it would normally expect if it doesn't exist?
Something along the lines of this maybe?
[[{{#ifexist:File:Mastery trait {{{1}}}.png|File:Mastery trait {{{1}}}.png|{{#ifexist:File:{{{1}}} icon.png|File:{{{1}}} icon.png|File:No icon.png}}|{{#if:{{{2|}}}|{{{2}}}|49px}}|link=Trait: {{{1}}}]]
--LordTrekie (talk) 14:59, 18 June 2018 (UTC)
Do you know how to make it work? I tried it, but icon width can't be changed, some adjustment is needed. --Damixon (talk) 15:43, 18 June 2018 (UTC)
I'll mess with it on my wiki and see if I can make it work, hold please. =) --LordTrekie (talk) 15:46, 18 June 2018 (UTC)
Fixed, seemingly. source--LordTrekie (talk) 16:19, 18 June 2018 (UTC)
<includeonly>[[{{#ifexist:File:Mastery trait {{{1}}}.png|File:Mastery trait {{{1}}}.png|{{#ifexist:File:{{{1}}} icon.png|File:{{{1}}} icon.png|File:No icon.png}}}}|{{#if:{{{2|}}}|{{{2}}}|49px}}|link=Trait: {{{1}}}]]</includeonly><noinclude>{{doc}}[[Category:Icon templates]]</noinclude>
Awesome! Works now, thanks. :) --Damixon (talk) 16:57, 18 June 2018 (UTC)
Any chance this template can be improved/adjusted? With current state, two pages using this template were added to Category:Pages with too many expensive parser function calls. These pages are Reputation traits and Personal traits/Race-specific Personal traits. I fixed this by using lighter version - Template:Traiticon2. Also, every non-starship trait using this template was added to Special:WantedPages with this format [[File:Mastery trait NAME.png‏‎]]. --Damixon (talk) 14:38, 1 July 2018 (UTC)
Other than reverting it to the way it was, there's no real way (I know of) to have it do what it does with the double checking file names. Perhaps we ought to just make sure that any trait icons calling on this template for mastery icons are instead shifted to the Masteryicon template and revert it to the way it was. Or rename/rework how the mastery icons are named to match the rest and eliminate the need for the check and the separate template.--LordTrekie (talk) 15:46, 1 July 2018 (UTC)
I guess it is time to adjust the StarshipMastery template and cut the File:Mastery trait NAME.png format. Thanks for your input on this. --Damixon (talk) 16:51, 1 July 2018 (UTC)