Forums / Setup & design / How to get the filename of an icon ?
Xavier Dutoit
Monday 09 May 2005 3:29:22 am
Hi,
The {$class_identifier|class_icon( small|normal|large, $class_name )} gets an xhtml img tag <img url='...
How can I just get the url of the file, without all the xhtml bla bla around ?
Thanks in advance,
Xavier
http://www.sydesy.com
Monday 09 May 2005 9:19:21 am
Found a way, not so elegant:
on my icon.ini.append:
[ClassIcons] # Default icon if there is no class match Default=mimetypes/empty.png # Mapping from a class identifier to it's icon file, # the whole filename must be included ClassMapID[] ClassMapID[2]=mimetypes/document.png ClassMapID[13]=mimetypes/txt2.png ClassMapID[14]=apps/package_settings.png ClassMapID[12]=mimetypes/binary.png ClassMapID[1]=filesystems/folder.png ...
Then on my template:
{let icons=ezini( "ClassIcons", "ClassMapID","icon.ini" ) icon_folder='/share/icons/crystal-admin/16x16_indexed'} file:{$icon_folder}/{$icons[$id]}