How to get the filename of an icon ?

Author Message

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

Xavier Dutoit

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]}

http://www.sydesy.com

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.