Share » Forums » Developer » Query on fetch children

Query on fetch children

Query on fetch children

Monday 14 August 2006 9:13:43 pm - 2 replies

Author Message

Claudia Kosny

Tuesday 15 August 2006 10:47:11 am

Hello Toms,

most likely the problem is that you do not use the node_id, but the node itself as parameter for the fetch function for subnodeslist.

Apart from that I would use the foreach statement instead of section loop. You need less code and IMO it is much clearer which variable holds which information. So the relevant part of your code would look like ( this is not tested...):

{def $subNodesList=array()}
{foreach $nodesList as $currentNode}
  {$currentNode.name|wash} {$currentNode.contentobject_id|wash} <br />
  {set $subNodesList = fetch( content, list, hash( parent_node_id, $currentNode.node_id,
                                                                       sort_by, array('name',true())))}

  {foreach $subNodesList as $subNode}
   {$subNode.name|wash} <br />
  {/foreach}
{/foreach}

One last thing: When posting here please surround your code examples with code tags (you can see an example on the righthand side when you write a post). This makes it much easier to tell the code apart from the question.

greetings from Luxembourg

Claudia

Toms King

Tuesday 15 August 2006 6:32:27 pm

thx, Claudia, got it

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

36 542 Users on board!

Forums menu