Word to image

Author Message

Niklas Gunnäs

Thursday 05 January 2006 6:12:11 am

Hi

I'm have started to create a simple template for listing projects. It looks more or less like Bug reports listed her at ez.no. What I would need help with is to show different image in front of projects listed, depending on two different values for example if priority is set to high and Category is set to community it will show a community image in red.

Regards

Niklas

Felix Laate

Friday 06 January 2006 9:35:23 am

Hi Niklas!

If you have some attributes "priority" and "category" in your "project" class, you could fetch the projects and loop through them

{foreach $all_projects as $project}

{if eq($project.data_map.priority.content,'high')}
<img src="high.gif">
{elseif eq($project.data_map.priority.content,'medium')}
<img src="medium.gif">
{else}
<img src="low.gif">
{/if}

.. the rest of the content of $project ..


{/foreach}

 

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.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 20:58:01
Script start
Timing: Jan 18 2025 20:58:01
Module start 'layout'
Timing: Jan 18 2025 20:58:01
Module start 'content'
Timing: Jan 18 2025 20:58:02
Module end 'content'
Timing: Jan 18 2025 20:58:02
Script end

Main resources:

Total runtime0.7522 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 587.7891152.6094
Module start 'layout' 0.00470.0029 740.398439.4141
Module start 'content' 0.00760.7430 779.8125526.5391
Module end 'content' 0.75070.0015 1,306.35168.1953
Script end 0.7521  1,314.5469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.5067160.0002
Check MTime0.00150.1971160.0001
Mysql Total
Database connection0.00070.095310.0007
Mysqli_queries0.696392.5670540.0129
Looping result0.00120.1557520.0000
Template Total0.717395.420.3586
Template load0.00350.462820.0017
Template processing0.713894.896320.3569
Template load and register function0.00020.027010.0002
states
state_id_array0.00220.288310.0022
state_identifier_array0.00120.163720.0006
Override
Cache load0.00300.4049150.0002
Sytem overhead
Fetch class attribute can translate value0.00080.109620.0004
Fetch class attribute name0.00270.362840.0007
XML
Image XML parsing0.00410.539020.0020
class_abstraction
Instantiating content class attribute0.00000.001340.0000
General
dbfile0.00550.7363220.0003
String conversion0.00000.000840.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
1content/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: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs