Access to ezselection-type attribute in a template

Author Message

E Hoelzler

Friday 01 December 2006 3:07:07 am

I have a class with an ezselection-type attribute (lets say attribute "fruit" with values "apple", "orange","ananas","banana") which may be multi-selected to assemble the ingredients of a fruit salad. Using the

{attribute_view_gui...}

I can easily display the value "orange ananas" if I have checked the second and the third. In the

$myobject.object.contentobject_attributes.content[0]

, for example, I get the indexnumber "1" indicating the second entry (namely: "orange"). Thus I can collect the indices of the entries, the user has checked (in our example index 1 and 2).

But: how can I access the string-content?

Or, in other words: How can I put the string "orange ananas" - or the single strings "orange" and "ananas" in to a template variable?

My Idea: in the contentclassattribute - object there is an attribute "content" with type "mixed" - perhaps it is somewhere behind this. But where?

Thanks a lot from munich for help!

Claudia Kosny

Friday 01 December 2006 2:49:00 pm

Hi

Haven't tried whether this is correct but as far as I know the string value of the selection is not stored in the contentobjectattribute, but only in the class definition. Check the comment here http://ez.no/doc/ez_publish/technical_manual/3_8/reference/datatypes/selection

Greetings from Luxembourg

Claudia

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 20:59:54
Script start
Timing: Jan 18 2025 20:59:54
Module start 'layout'
Timing: Jan 18 2025 20:59:54
Module start 'content'
Timing: Jan 18 2025 20:59:55
Module end 'content'
Timing: Jan 18 2025 20:59:55
Script end

Main resources:

Total runtime0.6747 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.1406152.6406
Module start 'layout' 0.00480.0028 740.781339.4766
Module start 'content' 0.00760.6657 780.2578460.0859
Module end 'content' 0.67330.0014 1,240.34388.1250
Script end 0.6747  1,248.4688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.4248160.0002
Check MTime0.00120.1831160.0001
Mysql Total
Database connection0.00060.092810.0006
Mysqli_queries0.639094.7034540.0118
Looping result0.00040.0648520.0000
Template Total0.651396.520.3256
Template load0.00160.243920.0008
Template processing0.649696.280720.3248
Template load and register function0.00010.022210.0001
states
state_id_array0.00040.057810.0004
state_identifier_array0.00080.121520.0004
Override
Cache load0.00130.1935170.0001
Sytem overhead
Fetch class attribute can translate value0.00050.068220.0002
Fetch class attribute name0.00110.163220.0006
XML
Image XML parsing0.00020.029020.0001
class_abstraction
Instantiating content class attribute0.00000.000720.0000
General
dbfile0.00050.0801100.0001
String conversion0.00000.001340.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
2content/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
2content/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: 10
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs