getting the value out of a selection datatype

Author Message

nicholas king

Friday 24 September 2010 1:59:02 am

Hello all, i am really struggling with getting the value out of the selection datatype into my template.

So far i have the following code. where briefing_area is the name of the selection datatype.

{$node.data_map.briefing_area.content}

all this prints out on screen is array although there is only one value inside the selection.

does anyone have a idea how i can get the string value out of the datatype.

Thanks

Nicholas

Abdelkader RHOUATI

Friday 24 September 2010 2:19:31 am

Hi,

If you are can't do it, let ez do it in your place ;).

there are a magic template operator attribute_view_gui, you can use it with every attribute, specially with complex one, like your selection.

the syntax is :

{attribute_view_gui  attribute=$node.data_map.briefing_area}

(for more information look at the template : /design/standard/templates/content/datatype/view/ezselection.tpl, the operator template attribute_view_gui will use it to display attribute selection)

TKS.

Abdelkader RHOUATI

Blog (french) : http://arhouati.com
----
Extension arh_jdebug : EzDebug using jquery

nicholas king

Friday 24 September 2010 2:23:04 am

Brilliant,

thank you very much Abdelkader.

that works a treat :-D

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 10:40:18
Script start
Timing: Jan 18 2025 10:40:18
Module start 'layout'
Timing: Jan 18 2025 10:40:18
Module start 'content'
Timing: Jan 18 2025 10:40:19
Module end 'content'
Timing: Jan 18 2025 10:40:19
Script end

Main resources:

Total runtime0.7310 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.0391152.6406
Module start 'layout' 0.00530.0038 740.679739.4844
Module start 'content' 0.00910.7204 780.1641537.2578
Module end 'content' 0.72950.0015 1,317.421912.1250
Script end 0.7309  1,329.5469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4445160.0002
Check MTime0.00140.1871160.0001
Mysql Total
Database connection0.00090.123010.0009
Mysqli_queries0.660190.3009570.0116
Looping result0.00070.0944550.0000
Template Total0.698295.520.3491
Template load0.00210.280920.0010
Template processing0.696195.235420.3481
Template load and register function0.00020.030210.0002
states
state_id_array0.00120.159010.0012
state_identifier_array0.00080.111920.0004
Override
Cache load0.00170.2382250.0001
Sytem overhead
Fetch class attribute can translate value0.00070.100220.0004
Fetch class attribute name0.00260.352150.0005
XML
Image XML parsing0.00851.158020.0042
class_abstraction
Instantiating content class attribute0.00000.001960.0000
General
dbfile0.00831.1287220.0004
String conversion0.00000.001540.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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/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: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs