fetch collected information id

Author Message

Alan Fowler

Tuesday 25 January 2011 6:24:08 am

Hi,

I'm looking for a way to fetch the list of collected information id's for an object. I can fetch the creator name using:

{$col.creator.contentobject.name|wash}

and can collect the attribute names and entries using:

{def $collection=fetch('content','collected_info_list', hash('object_id', $obj.id))}

{foreach $collection as $col}

{foreach $col.attributes as $colAttr} {$colAttr.contentclass_attribute_name}

{attribute_result_gui view=info attribute=$colAttr} {/foreach} {/foreach}

but how do you get the collected information 'id' to be output?

Many thanks

Alan

Franck Magnan

Tuesday 25 January 2011 11:20:10 am

Hello Alan,
to display all data of a variable, you can use the attribute operator.
For example, you can modify your code to get this:

{def $collection=fetch('content','collected_info_list', hash('object_id', $obj.id))}
    {foreach $collection as $col}
        {foreach $col.attributes as $colAttr}
            {$colAttr|attribute('show',1)}
        {/foreach}
    {/foreach}
{undef $collection}

++

--
Developer at Open Wide

Alan Fowler

Thursday 27 January 2011 1:33:20 pm

Hi Franck,

Many thanks - took a bit of further coding but I got there.

Best

Alan

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 04:29:34
Script start
Timing: Jan 18 2025 04:29:34
Module start 'layout'
Timing: Jan 18 2025 04:29:34
Module start 'content'
Timing: Jan 18 2025 04:29:35
Module end 'content'
Timing: Jan 18 2025 04:29:35
Script end

Main resources:

Total runtime0.9668 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.0078 587.9141152.6250
Module start 'layout' 0.00780.0028 740.539139.4688
Module start 'content' 0.01060.9548 780.0078541.2500
Module end 'content' 0.96540.0014 1,321.257812.1641
Script end 0.9668  1,333.4219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3320160.0002
Check MTime0.00130.1335160.0001
Mysql Total
Database connection0.00390.398810.0039
Mysqli_queries0.910994.2159590.0154
Looping result0.00040.0437570.0000
Template Total0.934496.620.4672
Template load0.00210.220320.0011
Template processing0.932296.424120.4661
Template load and register function0.00020.018910.0002
states
state_id_array0.00100.100510.0010
state_identifier_array0.00130.138120.0007
Override
Cache load0.00190.1936350.0001
Sytem overhead
Fetch class attribute can translate value0.00040.044620.0002
Fetch class attribute name0.00080.081840.0002
XML
Image XML parsing0.00070.070520.0003
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00080.0858150.0001
String conversion0.00000.000940.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
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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: 22
 Number of unique templates used: 8

Time used to render debug report: 0.0002 secs