Problems with section in a ezenum

Author Message

Albert Hornos

Thursday 26 May 2005 11:17:46 am

Hi I've problems with ezenum in a section.
I've a ezenum type attribute in a product that have 3 elements:
URL externa value='externo'
Compra value='compra'
Reserva value='reserva'

I just want change the image for each choice but my section not found properly and always have the same image

{section show=eq($node.object.data_map.tipo,'URL externa')}
                  <td><a href="{$node.data_map.url_externa.content}"><img src={"images/Compra.gif"|ezdesign} width="60" height="59" border="0" alt="" align="right"></a>
                  <div align="justify"><span class="TITOLS">{attribute_view_gui attribute=$node.object.data_map.name}</span><br><br>{attribute_view_gui attribute=$node.object.data_map.descripcion_corta}</div></td>
               {section-else}
                  {section show=eq($node.data_map.tipo,'Reserva')}              
                    <td><a href={$node.url|ezurl}><img src={"images/Reserva.gif"|ezdesign} width="60" height="59" border="0" alt="" align="right"></a>
                    <div align="justify"><span class="TITOLS">{attribute_view_gui attribute=$node.object.data_map.name}</span><br><br>{attribute_view_gui attribute=$node.object.data_map.descripcion_corta}</div></td>
                  {section-else}
                    <td><a href={$node.url|ezurl}><img src={"images/Compra.gif"|ezdesign} width="60" height="59" border="0" alt="" align="right"></a>
                    <div align="justify"><span class="TITOLS">{attribute_view_gui attribute=$node.object.data_map.name}</span><br><br>{attribute_view_gui attribute=$node.object.data_map.descripcion_corta}</div></td>
                  {/section}
               {/section}

Could someone help me?

Thanks

Ɓukasz Serwatka

Monday 30 May 2005 12:46:53 am

Hi,

Try with

{section show=eq( $node.object.data_map.list.content.enumobject_list.0.enumvalue, 'externo'}
    show for externo
{/section}

You will have to change numer 0 to 1 for Compra and 2 for Reserva and 'list' for your attribute name.

Enum datatype isn`t recommended, eZ publish support this datatype for backward compatibility.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Albert Hornos

Tuesday 31 May 2005 1:03:27 am

Thank you very much Lukasz it's worked perfectly!

Only one more thing, I shouldn't change the .0. , it's always the same. (perhaps someone need this code too)

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 06:25:01
Script start
Timing: Jan 19 2025 06:25:01
Module start 'layout'
Timing: Jan 19 2025 06:25:01
Module start 'content'
Timing: Jan 19 2025 06:25:01
Module end 'content'
Timing: Jan 19 2025 06:25:01
Script end

Main resources:

Total runtime0.0221 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 589.1797152.6250
Module start 'layout' 0.00680.0041 741.804739.4453
Module start 'content' 0.01090.0056 781.250089.4609
Module end 'content' 0.01640.0056 870.710934.3047
Script end 0.0220  905.0156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.004922.3775140.0004
Check MTime0.002411.0112140.0002
Mysql Total
Database connection0.00177.836210.0017
Mysqli_queries0.003214.349230.0011
Looping result0.00000.086310.0000
Template Total0.004118.510.0041
Template load0.00219.328710.0021
Template processing0.00209.111810.0020
Override
Cache load0.00156.853010.0015
General
dbfile0.00031.185080.0000
String conversion0.00000.059440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs