Icons are used throughout the webtop to provide visual cues for different content types and administrative tasks. Developers can add their own icon sets or reuse the ones that exist within the framework by default.
FarCry icons are loaded via a URL call to a simple facade that dynamically determines where to grab the icon source.
<img src="http://my.farcry.site/webtop/facade/icon.cfm?icon=myComponent.png&size=48&usecustom=true" />
The icon.cfm facade will work out the most suitable icon that matches the criteria nominated in the URL parameters of the call. Essentially it just delivers the icon via a CFCONTENT call. We do this so we don't have to have the icon listed under the webroot of your project which can be very useful when you have a plugin that has no webroot for example.
There is a custom tag that simplifies calling icons: ./core/tags/admin/icon.cfm
Farcry looks in the following directories for icons:
- <project>/www/wsimages/icons (this is where custom icons should go for projects)
- <plugin>/www/wsimages/icons (this is where custom icons should go for plugins)
- <project/www/images/icons (do not use this; for backward compatibility only)
- <project>/www/<plugin>/wsimages/icons (do not use this; for backward compatibility only)
- <core>/webtop/icons (don't put custom icons here; its just for the core framework)
The framework loops through all plugins in reverse order (its the standard cascade order for plugin execution.. ie. the last plugin called in your list is dominant). It will stop looking once it has found an icon that matches.
If no icon is found, FarCry uses a generic icon (based on the framework logo) instead.
Within the icon directory there is a folder for each icon size. You will need to place a copy of your icon at each of the relevant sizes into the relevant folder.
Its a good idea to provide an icon for every size. Different areas of the FarCry admin leverage different sized icons.