Displaying objects of a specific class

Author Message

Eirik Alfstad Johansen

Monday 29 September 2003 3:09:48 am

Hi,

Wanting to display a list of all the forum messages (class id 7), I wrote the following template code:

{let children=fetch('content','list',hash(class_id,7))}

{section name=Child loop=$children}
{node_view_gui view=line content_node=$Child:item}
{/section}

However, the code generates no output. According to "kernel/content/function_definition.php", "class_id" is a valid parameter, so I can't figure out what I'm doing wrong.

Any ideas?

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Adolfo Barragán

Monday 29 September 2003 9:12:27 am

You must specify the parent_node_id (is a required parameter in function_definition.php) and also you must filter by class_id, so your fetch function must be:

... fetch(content, list, hash(parent_node_id, $myNode, class_filter_type, include, class_filter_array, array(7) ) )

Regards
Adolfo Barragan

Eirik Alfstad Johansen

Monday 29 September 2003 11:33:53 pm

Thanks, Adolfo!

With the use of the depth parameter as well, I got it doing what I wanted.

Sincerely,

Eirik Johansen
http://www.netmaking.no/

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

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

Main resources:

Total runtime0.8669 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.0046 588.0313152.6406
Module start 'layout' 0.00460.0024 740.671939.4609
Module start 'content' 0.00700.8583 780.1328532.6875
Module end 'content' 0.86530.0015 1,312.820312.1563
Script end 0.8668  1,324.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3462160.0002
Check MTime0.00120.1438160.0001
Mysql Total
Database connection0.00060.067610.0006
Mysqli_queries0.819794.5661570.0144
Looping result0.00060.0731550.0000
Template Total0.838596.720.4192
Template load0.00220.248620.0011
Template processing0.836396.477720.4182
Template load and register function0.00010.014410.0001
states
state_id_array0.00090.099810.0009
state_identifier_array0.00130.148120.0006
Override
Cache load0.00180.2080240.0001
Sytem overhead
Fetch class attribute can translate value0.00090.102220.0004
Fetch class attribute name0.00100.119840.0003
XML
Image XML parsing0.00060.069220.0003
class_abstraction
Instantiating content class attribute0.00000.001150.0000
General
dbfile0.00080.0907160.0000
String conversion0.00000.001040.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/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
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs