images in menus depending on node

Author Message

Zdenek Ziegler

Monday 04 April 2005 4:43:02 pm

Hi,

I need to setup ezp to display images in menus - top, bottom and left. I have a class with 3attributes "image" to store these images. Some classes don't have these attributes, so in this case, I want to display some default images.
I know how to display images hard-coded in pagelayout.tpl, but don't know how to fetch it depending on node where I actually am.

Could someone help me?

Thanks,

Zdenek

Arran Price

Tuesday 05 April 2005 4:39:26 pm

We change the image dependant on node with the following (editted) code.

{set mynode=$module_result.node_id}

{section show=$mynode|eq('121')}
   {set section_image=1176}
{/section}
{section show=$mynode|eq('122')}
   {set section_image=1177}
{/section}

{set sideimage=fetch( 'content', 'node', 
   		         hash( 'node_id', $section_image )
	              )
}   


{attribute_view_gui attribute=$sideimage.object.data_map.image image_class=sideimage css_class=content-image-section}

Hope that helps.

Arran

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 19 2025 00:18:28
Script start
Timing: Jan 19 2025 00:18:28
Module start 'layout'
Timing: Jan 19 2025 00:18:28
Module start 'content'
Timing: Jan 19 2025 00:18:29
Module end 'content'
Timing: Jan 19 2025 00:18:29
Script end

Main resources:

Total runtime0.8601 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.0083 587.9375152.6250
Module start 'layout' 0.00830.0032 740.562539.4453
Module start 'content' 0.01150.8468 780.0078459.1172
Module end 'content' 0.85840.0017 1,239.12508.1563
Script end 0.8601  1,247.2813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.4530160.0002
Check MTime0.00170.1950160.0001
Mysql Total
Database connection0.00180.205110.0018
Mysqli_queries0.810494.2166540.0150
Looping result0.00080.0896520.0000
Template Total0.815994.920.4079
Template load0.00200.228620.0010
Template processing0.813994.624920.4070
Template load and register function0.00030.032910.0003
states
state_id_array0.00160.189010.0016
state_identifier_array0.00140.164920.0007
Override
Cache load0.00160.1884140.0001
Sytem overhead
Fetch class attribute can translate value0.00060.074420.0003
Fetch class attribute name0.00260.300420.0013
XML
Image XML parsing0.00020.028820.0001
class_abstraction
Instantiating content class attribute0.00000.000720.0000
General
dbfile0.00090.1032100.0001
String conversion0.00000.001040.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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