Getting child items of a folder

Getting child items of a folder

Thursday 05 January 2006 8:38:13 am - 3 replies

Modified on Thursday 05 January 2006 8:38:48 am by Jan Petter Dale

Author Message

Siw Helen Thorslund

Thursday 05 January 2006 10:15:28 am

You can make an override of the list view of your class for the members.
Then make this display whatever content you want in list view.

An example: http://ags.no/ags/om_ags/kontakt_oss

www.VZT.no ( http://www.VZT.no )
VZT References ( http://http://vzt.no/index.php/vzt_eng/referanser )
VZT Extensions ( http://vzt.no/index.php/vzt_eng/extensions )
www.MediaBase.no ( http://www.MediaBase.no )

Jan Petter Dale

Thursday 05 January 2006 11:41:56 am

Thank you for your reply.

I guess the real question in all this is how to loop through the child objects of a node/folder.

I.e.

/ezp/content/info01
/ezp/content/info02
/ezp/content/info03
/ezp/content/info04
/ezp/content/info05

If i then create a section that is connected to that content folder, what code makes me
able to loop through the chile objects of that folder(info01, info02, etc).

From my limited knowledge about programming, I can understand that this code:

{$node.object.data_map.realname.contentclass_attribute.name}:

it takes the current node, fetches the contentclass stored variables and makes you able to print it to the screen. The problem is that when I input this code to an override to the
specified folder(/ezp/content/), it will try to fetch the data from the current folder node, and
not the info01,info02,info03...etc which is the real nodes,items or objects(if that's what you call it) that stored the information i've put in.

Arran Price

Sunday 08 January 2006 4:13:33 pm

Hi,
Im a little confused as to what you are after.
Ive had a look at the link you provided, are you wanting more than just the name and the default icon on that page prior to going into the item itself?
If so you just need to override the line view of the item.

What currently is happening is that the folder by default will list all of its contents using the line view of each of those items. When you click into each item you get the full view of it. Each view can be overriden specifically.
If thats what you are after there is no need to loop through anything as the folder by default will "loop" through to disaply the line view of each element if contains.

If you are looking to do something else entirely which involves getting a number of content objects from somewhere then processing them, you need to do a "fetch" of which there is an examples page in the documentation.

hope thats of some help

Arran

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.