Forums / General / ezselection (no multiple) - how to fetch attribute values

ezselection (no multiple) - how to fetch attribute values

Author Message

Łukasz Serwatka

Wednesday 15 December 2004 4:01:52 am

Hi,

How to fetch all values from ezselection attribute?

{let class_attribute=fetch( 'content', 'class_attribute', hash( 'attribute_id', 231 ) )}
  {$class_attribute.name} //this works, give me only attribute name
{$class_attribute|attribute} //this generate strange error
{/let}

This is from DB

<?xml version="1.0" encoding="UTF-8"?>
<ezselection>
<options>
<option id="0"
name="value 0" />
<option id="1"
name="value 1" />
<option id="2"
name="value 2" />
<option id="3"
name="value 3" />
<option id="4"
name="value 4" />
</options>
</ezselection>

I need array like this

array( 0 => "value 0", 
       1 => "value 1", 
       2 => "value 2", 
       3 => "value 3",
       4 => "value 4"
     )

Thanks for any help

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Łukasz Serwatka

Thursday 16 December 2004 1:13:40 am

Hi,

Nobody know? I have class where one of class attributes is ezseletion datatype. I would like to view all values of this attribute. How to do that?

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Silke Fox

Thursday 16 December 2004 1:23:18 am

Hi Luke,

I think

{$class_attribute|attribute(show,2)}

should work...

I did the following to build a select list

<select name="xyz">
  {section name=xyz loop=$class_attribute.content.options}
    <option value="{$:item.id}">{$:item.name}</option>
  {/section}
</select>

silke

Łukasz Serwatka

Thursday 16 December 2004 1:33:22 am

Thank you silke.

{$class_attribute|attribute(show,2)} // generate error, i report this as a bug

I use your code to generate one demensional array, thanks a lot ;-)

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

eZ debug

Timing: Jan 18 2025 18:14:14
Script start
Timing: Jan 18 2025 18:14:14
Module start 'content'
Timing: Jan 18 2025 18:14:14
Module end 'content'
Timing: Jan 18 2025 18:14:14
Script end

Main resources:

Total runtime0.7473 sec
Peak memory usage4,096.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 587.8516180.8203
Module start 'content' 0.00470.6177 768.6719562.1563
Module end 'content' 0.62240.1248 1,330.8281336.7344
Script end 0.7472  1,667.5625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.5762210.0002
Check MTime0.00170.2254210.0001
Mysql Total
Database connection0.00050.072010.0005
Mysqli_queries0.665389.02631970.0034
Looping result0.00210.28561950.0000
Template Total0.722396.720.3611
Template load0.00200.271920.0010
Template processing0.720396.379220.3601
Template load and register function0.00010.013410.0001
states
state_id_array0.00080.112910.0008
state_identifier_array0.00100.128320.0005
Override
Cache load0.00180.2390430.0000
Sytem overhead
Fetch class attribute can translate value0.00150.199930.0005
Fetch class attribute name0.00140.184250.0003
XML
Image XML parsing0.00100.129030.0003
class_abstraction
Instantiating content class attribute0.00000.002170.0000
General
dbfile0.00640.8624290.0002
String conversion0.00000.000830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 25
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs