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.

eZ debug

Timing: Jan 18 2025 19:23:45
Script start
Timing: Jan 18 2025 19:23:45
Module start 'layout'
Timing: Jan 18 2025 19:23:45
Module start 'content'
Timing: Jan 18 2025 19:23:45
Module end 'content'
Timing: Jan 18 2025 19:23:45
Script end

Main resources:

Total runtime0.6834 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 589.1328152.6250
Module start 'layout' 0.00550.0027 741.757839.4453
Module start 'content' 0.00820.6732 781.2031487.2969
Module end 'content' 0.68140.0020 1,268.50008.1563
Script end 0.6834  1,276.6563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.5207160.0002
Check MTime0.00150.2187160.0001
Mysql Total
Database connection0.00100.150110.0010
Mysqli_queries0.632192.4896520.0122
Looping result0.00060.0812500.0000
Template Total0.647494.720.3237
Template load0.00240.357420.0012
Template processing0.644994.368520.3225
Template load and register function0.00010.018010.0001
states
state_id_array0.00090.132110.0009
state_identifier_array0.00160.227620.0008
Override
Cache load0.00200.2880160.0001
Sytem overhead
Fetch class attribute can translate value0.00110.159110.0011
Fetch class attribute name0.00110.162430.0004
XML
Image XML parsing0.00070.102710.0007
class_abstraction
Instantiating content class attribute0.00000.001340.0000
General
dbfile0.00160.2411160.0001
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs