Fetching an array of nodes

Fetching an array of nodes

Wednesday 26 January 2005 2:54:16 am - 3 replies

Author Message

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}

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.