Thursday 16 March 2006 7:12:33 am
In PHP, the class attribute options of the selection datatype are structured like this:
array(
array( 'id' => 1, 'name' => 10 ),
array( 'id' => 2, 'name' => 20 )
)
Now if you ever added options in an incorrect order and later corrected your mistake by reordering them, you can get this:
array(
array( 'id' => 1, 'name' => 10 ),
array( 'id' => 2, 'name' => 20 ),
array( 'id' => 4, 'name' => 30 ),
array( 'id' => 3, 'name' => 40 ),
)
So I think this should do it:
{def $statusAttrib=$Child:item.object.data_map.status}
{foreach $statusAttrib.contentclass_attribute.content.options as $classAttribOption}
{if $classAttribOption.id|eq(statusAttrib.content[0])}
<img src={concat(status, $classAttribOption.name, ".gif")|ezimage} alt="projectimage" align="absmiddle"> {attribute_view_gui attribute=$statusAttrib}%
{/if}
{/foreach}
{undef $statusAttrib}
independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org
|