This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » Setup & design » Fetching files with a different main...

Fetching files with a different main location compared to my current location

Fetching files with a different main location compared to my current location

Monday 25 June 2012 9:32:34 am - 4 replies

Hi there,

don't know if I hit the right board, but anyway I dare to ask in here...

I want my PDF Files stored in a single place under "Media Section", so I have to reupload them only once, on any change. On the other hand I want to use the files in different locations, so I added some new locations to my files. If I browse to that location (backend), I can find my PDF there in place. Perfect.

But I want them also fetched in a template. But that only works, if the main location is set to a specific site, what means it is not working all over the place.

The problem is the "parent node id", I guess...

 {def $files=fetch( content, list, hash( 'parent_node_id', $object.node_id,
                                             'class_filter_type', 'include',
                                            'class_filter_array', array( 'file' ),
                                            'sort_by', array( 'priority', ascending ),
                                            'language', ezini( 'RegionalSettings', 'Locale', 'site.ini' ) ) ) }


Is there any solution to this?


Monday 25 June 2012 10:15:55 am


Check your user rights. By default files in Media section are not readable.

Monday 25 June 2012 10:18:38 am


I see, that the fetch function is wrong. You made two mistakes in fetch function: parent_node_id and sort_by.

Here is the doc for fetch function:


Modified on Monday 25 June 2012 10:20:14 am by Karol Radziuk

Monday 25 June 2012 2:09:48 pm


I'm logged in as admin.

I've corrected sort_by, but what is wrong with parent_node_id?

It's still not working.


Monday 25 June 2012 2:52:17 pm

Ivo, you're right. It is a permission issue.

Thanks for your support, guys.


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

36 542 Users on board!

Forums menu

Proudly Developed with from