Fetching the enum object value

Author Message

Sander Jansen

Thursday 02 October 2003 1:33:08 am

I want to use the value of an enum datatype in a switch operator... so far I figured out access to the object with $content_version.data_map.<attribute_name>.content, but how do I access the actual value?

Tony Wood

Thursday 02 October 2003 2:02:00 am

Hi Sander,

This can be found in ezenum.tpl. I have changed the example to show enumvalue not enumelement that is in the original file.

{section name=EnumObjectList loop=$attribute.content.enumobject_list sequence=array(bglight,bgdark)}
{$EnumObjectList:item.enumvalue|wash(xhtml)}<br />
{/section}

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Thomas Brandl

Thursday 02 October 2003 5:22:05 am

use attribute_view_gui instead. That's exactly, what that function is for, namly displaying an objects attribute - and you don't need to care, what type it is.

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 16:21:28
Script start
Timing: Jan 18 2025 16:21:28
Module start 'layout'
Timing: Jan 18 2025 16:21:28
Module start 'content'
Timing: Jan 18 2025 16:21:28
Module end 'content'
Timing: Jan 18 2025 16:21:28
Script end

Main resources:

Total runtime0.0192 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.0060 589.0469152.6250
Module start 'layout' 0.00600.0034 741.671939.4609
Module start 'content' 0.00940.0075 781.132889.3203
Module end 'content' 0.01690.0023 870.453130.3047
Script end 0.0192  900.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002714.0916140.0002
Check MTime0.00126.2385140.0001
Mysql Total
Database connection0.00073.782110.0007
Mysqli_queries0.003115.899530.0010
Looping result0.00000.088010.0000
Template Total0.00189.610.0018
Template load0.00105.081610.0010
Template processing0.00094.505010.0009
Override
Cache load0.00073.593610.0007
General
dbfile0.00158.046580.0002
String conversion0.00000.057040.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.0001 secs