How to output a single select menu value

Author Message

Tony Stark

Monday 16 February 2009 9:03:35 am

Hi,

I have an issue where I want to output a value of an object held in a "Selection" attribute *Single Choice). I have tried numerous ways I was sure which worked befire but none of them seem to be yielding any results?!

So, question is - how do I output a value from a single choice, selection attribute?!

Many thanks in advance....

Tony

justin kazadi

Monday 16 February 2009 11:32:35 pm

Hi tony,

if i well understand what you have says. you want to have the selected choise from the selection datatype.

try this code:

{$node.data_map.name_of__your_attribute.content.0}

use $node if you are in an override template.

i think this could help you.

The theory is when we know everything and nothing works.
The practice is when everything works and nobody knows why.
If the practice and theory are met, nothing works and we do not know why.

Albert Einstein

Pierre SCALFATI

Thursday 19 February 2009 5:52:47 am

I've been also using this, and it works also :

$node.data_map.name_of_your_attribute.data_text

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 18 2025 15:12:04
Script start
Timing: Jan 18 2025 15:12:04
Module start 'layout'
Timing: Jan 18 2025 15:12:04
Module start 'content'
Timing: Jan 18 2025 15:12:05
Module end 'content'
Timing: Jan 18 2025 15:12:05
Script end

Main resources:

Total runtime0.7376 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 588.0469152.6406
Module start 'layout' 0.00590.0028 740.687539.4766
Module start 'content' 0.00870.7277 780.1641562.1484
Module end 'content' 0.73640.0011 1,342.31258.1250
Script end 0.7376  1,350.4375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4470160.0002
Check MTime0.00140.1883160.0001
Mysql Total
Database connection0.00120.168510.0012
Mysqli_queries0.691993.8112590.0117
Looping result0.00050.0710570.0000
Template Total0.709096.120.3545
Template load0.00210.286320.0011
Template processing0.706895.830320.3534
Template load and register function0.00010.014910.0001
states
state_id_array0.00080.106310.0008
state_identifier_array0.00110.148320.0005
Override
Cache load0.00180.2401180.0001
Sytem overhead
Fetch class attribute can translate value0.00050.062630.0002
Fetch class attribute name0.00110.148340.0003
XML
Image XML parsing0.00080.110530.0003
class_abstraction
Instantiating content class attribute0.00000.001640.0000
General
dbfile0.00070.1001160.0000
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs