Template:Skill icon: Difference between revisions

From FHX Wiki
mNo edit summary
Line 29: Line 29:
** <code><nowiki>[[{{{1}}}|]]</nowiki></code> doesn't seem to work via template code, but works in the above example. Also tried <code><nowiki>&#124;</nowiki></code> and <code><nowiki>{{!}}</nowiki></code>.
** <code><nowiki>[[{{{1}}}|]]</nowiki></code> doesn't seem to work via template code, but works in the above example. Also tried <code><nowiki>&#124;</nowiki></code> and <code><nowiki>{{!}}</nowiki></code>.
** Consider adding (skill) for all skill articles. <code><nowiki>[[{{{1}}} (skill)|{{{1}}}]]</nowiki></code>
** Consider adding (skill) for all skill articles. <code><nowiki>[[{{{1}}} (skill)|{{{1}}}]]</nowiki></code>
** Might be able to use <code><nowiki>{{#ifexist:}}</nowiki></code> parser as a workaround for the article link - <code><nowiki>if "{{{Hammer}}} (skill) icon.gif" exists, [[{{{Hammer}}} (skill)|{{{Hammer}}}]], else [[{{{Hammer}}}]]</nowiki>/code>
** Might be able to use <code><nowiki>{{#ifexist:}}</nowiki></code> parser as a workaround for the article link - <code><nowiki>if "{{{Hammer}}} (skill) icon.gif" exists, [[{{{Hammer}}} (skill)|{{{Hammer}}}]], else [[{{{Hammer}}}]]</nowiki></code>
*** Would be dependent on the skill icon being present, but could function as a catchall for any other skills that need "(skill)" at the end of the name to separate it from another feature.  
*** Would be dependent on the skill icon being present, but could function as a catchall for any other skills that need "(skill)" at the end of the name to separate it from another feature.
*** May not need to depend on icon if the skill page exists (Hammer (skill))
* Add {{#if}} to include article link or only icon.
* Add {{#if}} to include article link or only icon.
** May not worry about this. Might be necessary to include article link each time a skill is referenced.  
** May not worry about this. Might be necessary to include article link each time a skill is referenced.  

Revision as of 06:31, 21 June 2024

Warning:
This template is in draft.

Description

{{skill icon|<skill name>}}

Displays a link to the skill and adds a skill icon in front of it.

Parameters

1 (unnamed parameter)
Skill name.
2 (unnamed parameter)
Icon size. Options: "big" (48px), "huge" (100px), or, blank (32px) - which is the default size.

Examples

  • Magic Defense is produced from {{skill icon|Magic Defense}}
  • Magic Defense is produced from {{skill icon|Magic Defense|big}}
  • Magic Defense is produced from {{skill icon|Magic Defense|huge}}
  • Revive is produced from {{skill icon|Revive}}
  • Teleport is produced from {{skill icon|Teleport}}
  • Visit is produced from {{skill icon|Visit}}
  • Invite is produced from {{skill icon|Invite}}
  • Party Recall is produced from {{skill icon|Party Recall}}
  • Hammer (skill) is produced from {{skill icon|Hammer (skill)}}
  • Manufacture is produced from {{skill icon|Manufacture}}


TODO:

  • Can file pages have (skill) in the name? I believe () normally isn't allowed in windows file naming.
    • If so, I'd like to figure out how to exclude (skill) from the displayed article link (e.g. Hammer or Hammer)
    • [[{{{1}}}|]] doesn't seem to work via template code, but works in the above example. Also tried | and {{!}}.
    • Consider adding (skill) for all skill articles. [[{{{1}}} (skill)|{{{1}}}]]
    • Might be able to use {{#ifexist:}} parser as a workaround for the article link - if "{{{Hammer}}} (skill) icon.gif" exists, [[{{{Hammer}}} (skill)|{{{Hammer}}}]], else [[{{{Hammer}}}]]
      • Would be dependent on the skill icon being present, but could function as a catchall for any other skills that need "(skill)" at the end of the name to separate it from another feature.
      • May not need to depend on icon if the skill page exists (Hammer (skill))
  • Add {{#if}} to include article link or only icon.
    • May not worry about this. Might be necessary to include article link each time a skill is referenced.
  • Import all skill icon image files (Skill Name icon.png)
    • need to get export
    • At least start with Teleport, Visit, Invite, Party Recall, and Revive as they are commonly referenced