Forums / Setup & design / How to fetch nodes that belong to differents sections ?

How to fetch nodes that belong to differents sections ?

Author Message

Benjamin Lemoine

Thursday 18 May 2006 9:31:16 am

Hi !

I've differents scattered nodes in my main tree that belong to differents sections.

I want to know if there is a solution wich permits to fetch these nodes according to a section?

ex: fetch('content', 'node', hash('parent_node_id', 2, 'section_id', 6))

Thanks.

Stuart Fenton

Thursday 18 May 2006 10:10:35 am

Yes you can add a section id to the fetch statement.

Have a look here:
http://ez.no/products/ez_publish/documentation/customization/tips_tricks/fetch_function_examples

Regards
Fats

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Benjamin Lemoine

Thursday 18 May 2006 11:38:07 pm

Thanks for your reply, but this fetch function only permit to sort nodes by section.

What I want is fetch nodes that belong to one particular section.

Any ideas ?

Ɓukasz Serwatka

Thursday 18 May 2006 11:45:12 pm

Hi Benjamin,

You can use object_list
http://ez.no/doc/ez_publish/technical_manual/3_7/reference/modules/section/fetch_functions/object_list

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Benjamin Lemoine

Friday 19 May 2006 12:17:45 am

Thanks, it works !

But now, is it possible to limit to one level?
Example:

- My tree

| Main
|
|-- Folder1
|----- Subfolder
|----- Article
|
|-- Folder 2
|----- Subfolder1
|----- Subfolder2
|
|-- Folder 3
|----- Subfolder1
|----- Subfolder2
|
|-- ........

I want to make a menu that only contains Folder 1 and Folder 3. So I've created a section that contains Folders 1 & 3. And, with fetch object by section_id, it displays :
- Folder 1
- Subfolder
- Article
- Folder 3
- Subfolder
- Subfolder

Can I limit the fetch to the first level ?