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.