Caution: This documentation is for Exponential, from version 3.x to 6.x.
For 5.x documentation covering Platform see Exponential Platform Documentation, for difference between legacy and Platform see 5.x Architecture overview.

For an speed boost and lowering number of fetches / sql quries

If you need to display some information about the children or grand children in the node template this is possible with $node.children and $node.children.0.children (if any children exist this will loop thru any children of your first child)
To loop thru children:

<table>
{foreach $node.children as $nodechild}
   <tr>
    <td><a href={$nodechild.url_alias|ezurl}>{$nodechild.name}</a></td>
    <td>{$nodechild.node_id}</td>
  </tr>
{/foreach}
</table>


The same thing can be done with parents: $node.parent

Remember to only use $node in node templates and not in your pagelayout file.
Because it's not available on cached pages (ViewCaching).
  • Re: Re: For an speed boost and lowering number of fetches / sql quries

    This is wrong!

    .children and some other variables are dynamicly feched if you use them.
    So it's better to use tree fetch if you want content on different levels!

Anonymous User (12/01/2006 10:22 am)

Svitlana Shatokhina (16/02/2007 12:32 pm)


Comments

  • Re: Re: For an speed boost and lowering number of fetches / sql quries

    This is wrong!

    .children and some other variables are dynamicly feched if you use them.
    So it's better to use tree fetch if you want content on different levels!