Forums / Setup & design / view "siblings"

view "siblings"

Author Message

ole poulsen

Monday 27 February 2006 6:14:07 am

I have been trying to code it out myself and to find information here....alas both without any luck.

My problem is: how do I display a node's "siblings"?

Not "children", not "parent" but "children of parent" - that must be possible, right?
(is it clear what i mean?)

What i want is of course that when I have a page (node) with a list of links to this node's children, when the user clicks one of these links, the content appears in one "box" and I want it to STILL display the same list of links, so the user doesn't have to click back all the time in order to see more articles for example.

If it is clear, what I need (?) - how do I do that, please?

Gabriel Ambuehl

Monday 27 February 2006 6:18:59 am

Shouldn't siblings be:

{$node.parent.children}

?

(Obviously that also lists the current node but it's easy enough to filter that)

Visit http://triligon.org

ole poulsen

Monday 27 February 2006 6:30:46 am

thanks, but sorry, no, that doesn't work. Not in that form that is.

Marko Žmak

Wednesday 01 March 2006 1:57:06 pm

In what way did you try this code?

If you want sibilings of a node $node then try:

{foreach $node.parent.chidren as $child}
{$child.name}
{/foreach}

If you want sibilings of an object $object then try:

{foreach $object.main_node.parent.chidren as $child}
{$child.name}
{/foreach}

Also remember that each object can have more than one parent node, so it can have different sibilings for different parent nodes.

Also have a look at this:

http://ez.no/doc/ez_publish/technical_manual/3_6/reference/objects/ezcontentobject

http://ez.no/doc_hidden/ez_publish/technical_manual/3_6/reference/objects/ezcontentobjecttreenode

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

ole poulsen

Thursday 02 March 2006 4:14:23 am

Yay! It works now, thanks!

Except you forgot a 'l' in 'children' - just in case someone is going to copy-paste this code, it should of course be:

{foreach $node.parent.children as $child}
{$child.name}
{/foreach}