Instead, let the template object have a function to make this decision. The template can redirect to the default path if no custom icon is specified.
If you do it this way, you can also change the icon which is shown in the common elements section of the ribbon menu.