Forums / Developer / Fetching Object Relations

Fetching Object Relations

Author Message

Sandeep Kadam

Tuesday 29 June 2010 2:29:11 am

Hi All,
I Have a class named "Guest room" in which i have used attribute name "Masthead Images" of type "Object relations" as a container for rotation images on my web pages...
I have uploaded images in Media Library/Images folder.
and added that images as an "add objects" for "Masthead Images" attribute in "Guest room" class object.
What i need is to fetch url of that images so that i can use it in script for rotation..
Please let me know if i need to explain more about my requirement.. Please some one help me in this.. please
Thank you ,
Sandeep

Ivo Lukac

Wednesday 30 June 2010 2:35:08 am

Use something like this. Writing from my memory, so check syntax :)

{def $relnode}
{foreach $node.data_map.masthead_images.content.relation_list as $rel}
 {set $relnode = fetch(content, node, hash(node_id, $rel.node_id))}
 <img src="{$relnode.data_map.image.content[original].full_path|ezroot}"/>
{/foreach}
{undef $relnode}

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Sandeep Kadam

Wednesday 30 June 2010 4:12:19 am

HI Ivo Lukac,

Thank you very much this realy is the code which i required. And I got it done.
Thanks..........Cheerssssss :)

Sandeep

Simon Boyer

Wednesday 13 July 2011 8:02:12 am

Hi,

I added an extension to do this :

http://projects.ez.no/oworfilter

This extension provides an extended attribute filter to fetch by object relation(s).

--
Developer at Open Wide