Fetching an array of nodes

Author Message

Jonathan Marsigny

Wednesday 26 January 2005 2:54:16 am

Hello,

I try to do this :

$my_array=(1,2,3,4)
{let nodes=fetch(content,node,hash(node_id,$my_array))}

Can you confirm it doesn't work ?

Regards

Balazs Halasy

Wednesday 26 January 2005 5:29:23 am

Hi,

This will not work because the content/node fetch expects a single node ID and not an array of node IDs. What is it that you want to do? Maybe we can help you..

Allman

Jonathan Marsigny

Wednesday 26 January 2005 7:12:00 am

I want to fetch some nodes to build menu.
I have some questions.

1) Can I do fetch in {case} {/case}?
2) How can fetch an array of nodes and write their name.

My code :

{let 	  anonyme=array(58)
		formateur=array(58,59,60,61)
		contact=array(58,59,60,61,105,64)
		user_courrant=fetch(user,current_user)
		group_courrant=$user_courrant.contentobject.parent_nodes}
		
<ul>
{let data=fetch(content,node,hash(node_id,$anonyme.0))}
{section loop=$formateur}
{let data2=fetch(content,node,hash(node_id,$formateur.$i)
$i=$i+1
{/section}

{switch name=element match=$group_courrant.0}
{case match=44}
<li><a href={$data.url_alias|ezurl}>{$data.name|wash}</a></li>
{/case}
{case in=array(73,76,79)}
{* some names here from an array*
......
...

Jonathan Marsigny

Friday 28 January 2005 2:49:45 am

ok, finally I use this :

$formateur=array...

{section loop=$formateur}
{set b=fetch(content,node,hash(node_id,$:item))
}
<li><a href={$b.url_alias|ezurl}>{$b.name|wash}</a></li>
{/section}

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 31 2025 01:28:14
Script start
Timing: Jan 31 2025 01:28:14
Module start 'layout'
Timing: Jan 31 2025 01:28:14
Module start 'content'
Timing: Jan 31 2025 01:28:15
Module end 'content'
Timing: Jan 31 2025 01:28:15
Script end

Main resources:

Total runtime0.8490 sec
Peak memory usage8,192.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.1250151.2109
Module start 'layout' 0.00470.0033 739.3359220.6875
Module start 'content' 0.00800.8402 960.02344,422.5703
Module end 'content' 0.84820.0008 5,382.593811.8516
Script end 0.8490  5,394.4453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4028160.0002
Check MTime0.00130.1473160.0001
Mysql Total
Database connection0.00070.078710.0007
Mysqli_queries0.764790.0642600.0127
Looping result0.00060.0669580.0000
Template Total0.797193.920.3985
Template load0.00200.241020.0010
Template processing0.795093.639320.3975
Template load and register function0.00150.181010.0015
states
state_id_array0.00200.241310.0020
state_identifier_array0.00170.196620.0008
Override
Cache load0.00170.2010250.0001
Sytem overhead
Fetch class attribute can translate value0.00150.178320.0008
Fetch class attribute name0.00190.223350.0004
XML
Image XML parsing0.00220.263920.0011
class_abstraction
Instantiating content class attribute0.00000.001550.0000
General
dbfile0.00290.3374160.0002
String conversion0.00000.000640.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
4content/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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.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: 18
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs