Selection datatype value

Author Message

Tuesday 19 April 2005 10:30:33 am

Hi all,

How do I check that a selection datatype has a certain value?

I've tried this code without success.

{section show=eq( $node.object.data_map.aktivitetstype, Utdanning )}
<tr bgcolor="#CCCC99">
{/section}

The code

{attribute_view_gui attribute=$node.object.data_map.aktivitetstype}

shows the value Utdanning

Paul Borgermans

Tuesday 19 April 2005 11:38:34 am

Hi

The reason is that $node.object.data_map.aktivitetstype is still an object, where you need the value.

For simple text/numerical/date datatypes, you can access the real value through the .content member. For the more complex datatypes, you need more. The selection datataype can be one or more values so the following code should work if I remember correctly:

{section show=eq( $node.object.data_map.aktivitetstype.content.0, 'Utdanning' )}
<tr bgcolor="#CCCC99">
{/section}


The specifier content.0 means the first element of the array which is returned in the case of the selection datatype

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Eivind Marienborg

Tuesday 19 April 2005 11:38:34 am

What output do you get from

$node.object.data_map.aktivitetstype.data_int

Try matching on that in stead:

{section show=eq( $node.object.data_map.aktivitetstype.data_int, NUMBER  )}
<tr bgcolor="#CCCC99">
{/section}

Hope this helps.

Eivind Marienborg

Tuesday 19 April 2005 11:42:19 am

..at the exact same time. Just ignore my last post ;)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.