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.

eZ debug

Timing: Jan 19 2025 09:14:56
Script start
Timing: Jan 19 2025 09:14:56
Module start 'layout'
Timing: Jan 19 2025 09:14:56
Module start 'content'
Timing: Jan 19 2025 09:14:56
Module end 'content'
Timing: Jan 19 2025 09:14:56
Script end

Main resources:

Total runtime0.0259 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.0079 589.1563152.6250
Module start 'layout' 0.00790.0057 741.781339.4453
Module start 'content' 0.01370.0096 781.226693.4453
Module end 'content' 0.02330.0022 874.671934.3047
Script end 0.0255  908.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002610.1475140.0002
Check MTime0.00114.3502140.0001
Mysql Total
Database connection0.00104.044410.0010
Mysqli_queries0.006223.797830.0021
Looping result0.00000.104110.0000
Template Total0.00176.610.0017
Template load0.00093.426410.0009
Template processing0.00083.121510.0008
Override
Cache load0.00062.352410.0006
General
dbfile0.002810.950680.0004
String conversion0.00000.046140.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.0002 secs