History of function_biticon
Version 5
tikicon is a new function availible to smarty templates to support two things:
1) Icon themes - tikicon allows icons to be overidden in the same way that smarty allows templates to be over ridden. This allows a site to mix and match themes with icon sets for a more customized look with less work.
2) Better support of WAI accessibility for the handicapped - tikicon automatically generates any additional HTML needed to enable accessibility devices to function.
tikicon is used in your templates to replace the hard coded image tags that are used for icons through out Tiki. In a template it would look like this:
{$tikicon ipackage="blogs" iname="admin" iexplain="Configure blog settings" class="somecssclass"}
Very similar to an image tag in usage. These are the defined attributes:
ipackage (required): This indicates which package is home to this icon. General purpous shared icons like delete, trash, smileys, ect come from the kernel package. This also allows us to have a seperate "nextPage" icon for forums, one for image galleries, and one for wiki.
iname (required): This is the base name of the icon that you want to use. Notice that there is no extension like .png, .gif, ect. This is intentional and tikicon will allow any type of image to be used and find the correct file for you. It will also generate correctly formed HTML for that file class.
iexplain (optional): This is equivelent to the alt attribute in an img tag. This will generate the alt tag in the page, but will also be used to correctly generate HTML to allow screen readers and other accessibility devices for the physically challenged to function correctly. additionally it will add the same value to the title attribute, giving the user a hover tooltip.
ipath (optional): here you can specify a folder within the ipackage. for example the flags are stored in users/icons/flags, you would set:
{tikicon ipackage="users" ipath="flags/" iname="some_flag" iexplain="some_country"}
note: ipath requires a trailing '/' to work correctly.
These are the only four attributes specific to tikicon. Any other attributes, such as class above, are pased through to the HTML tag unaltered.
The image file used for the icon is selected by searching a defined set of folders including the current icon theme from the admin-general panel, the current site theme, and a default set of core Tiki icons. Each icon is treated seperately, so icon themes or site themes can overide only the individual icons they want to change. Tikicon will automatically fall back to the defaults if there is no override. It works much like the template override system that allows themes. So the above command might generate:
<img src="themes\styles\loveandkisses\icons\blogs\admin.png" alt="="Configure blog settings" class="somecssclass"> if the icon theme is loveandkisses and it overides that icon.
<img src="themes\styles\classicarcade\icons\blogs\admin.gif" alt="="Configure blog settings" class="somecssclass"> if the site theme is classicarcade and it overides that icon.
<img src="blogs\icons\admin.jpg" alt="="Configure blog settings" class="somecssclass"> if the neithier the icon theme or site theme override the admin icons.
This is the search path used by tikicon. The 1st match found is used.
If the file is not found in any of these locations an image tage with a src of broken.<ipackage>/<iname> will be output.
note: if ipath is not set, this setting will be ignored
note: to use variables within {tikicon} you will have to 'escape' the variables with '`'.
e.g. {tikicon ipackage="users" ipath="flags/" iname="`$userPrefs.flag`" iexplain="`$userPrefs.flag`"}
1) Icon themes - tikicon allows icons to be overidden in the same way that smarty allows templates to be over ridden. This allows a site to mix and match themes with icon sets for a more customized look with less work.
2) Better support of WAI accessibility for the handicapped - tikicon automatically generates any additional HTML needed to enable accessibility devices to function.
tikicon is used in your templates to replace the hard coded image tags that are used for icons through out Tiki. In a template it would look like this:
{$tikicon ipackage="blogs" iname="admin" iexplain="Configure blog settings" class="somecssclass"}
Very similar to an image tag in usage. These are the defined attributes:
ipackage (required): This indicates which package is home to this icon. General purpous shared icons like delete, trash, smileys, ect come from the kernel package. This also allows us to have a seperate "nextPage" icon for forums, one for image galleries, and one for wiki.
iname (required): This is the base name of the icon that you want to use. Notice that there is no extension like .png, .gif, ect. This is intentional and tikicon will allow any type of image to be used and find the correct file for you. It will also generate correctly formed HTML for that file class.
iexplain (optional): This is equivelent to the alt attribute in an img tag. This will generate the alt tag in the page, but will also be used to correctly generate HTML to allow screen readers and other accessibility devices for the physically challenged to function correctly. additionally it will add the same value to the title attribute, giving the user a hover tooltip.
ipath (optional): here you can specify a folder within the ipackage. for example the flags are stored in users/icons/flags, you would set:
{tikicon ipackage="users" ipath="flags/" iname="some_flag" iexplain="some_country"}
note: ipath requires a trailing '/' to work correctly.
These are the only four attributes specific to tikicon. Any other attributes, such as class above, are pased through to the HTML tag unaltered.
The image file used for the icon is selected by searching a defined set of folders including the current icon theme from the admin-general panel, the current site theme, and a default set of core Tiki icons. Each icon is treated seperately, so icon themes or site themes can overide only the individual icons they want to change. Tikicon will automatically fall back to the defaults if there is no override. It works much like the template override system that allows themes. So the above command might generate:
<img src="themes\styles\loveandkisses\icons\blogs\admin.png" alt="="Configure blog settings" class="somecssclass"> if the icon theme is loveandkisses and it overides that icon.
<img src="themes\styles\classicarcade\icons\blogs\admin.gif" alt="="Configure blog settings" class="somecssclass"> if the site theme is classicarcade and it overides that icon.
<img src="blogs\icons\admin.jpg" alt="="Configure blog settings" class="somecssclass"> if the neithier the icon theme or site theme override the admin icons.
Search Path!!
This is the search path used by tikicon. The 1st match found is used.
- <TIKI_THEME_PATH>/styles/<icon style>/icons/<ipackage>/<ipath>/<iname>.*
- <TIKI_THEME_PATH>/styles/<site style>/icons/<ipackage>/<ipath>/<iname>
- <TIKI_ROOT_PATH>/<ipackage>/icons/<ipath>/<iname>.*
- <TIKI_THEME_PATH>/styles/default/icons/<ipackage>/<ipath>/<iname>.*
If the file is not found in any of these locations an image tage with a src of broken.<ipackage>/<iname> will be output.
note: if ipath is not set, this setting will be ignored
note: to use variables within {tikicon} you will have to 'escape' the variables with '`'.
e.g. {tikicon ipackage="users" ipath="flags/" iname="`$userPrefs.flag`" iexplain="`$userPrefs.flag`"}