how to fetch the object relation(attributes)..?

how to fetch the object relation(attributes)..?

Saturday 09 December 2006 5:08:22 am - 3 replies

Author Message

Jacobo Quiles

Monday 11 December 2006 12:40:46 am

Hi, you could try something like this:

Assuming we are watching the full view of a subject:

{* Fetch all the related objects from the node that is being viewed *}

{def $teachers=fetch('content','related_objects',hash('object_id', $node.object.id, 'all_relations', true()))}

{* Foreach related teacher, show the attributes *}

{foreach $teachers as $teacher}
    {attribute_view_gui attribute=$teacher.main_node.data_map.name}<br/>
    {attribute_view_gui attribute=$teacher.main_node.data_map.qualification}<br/>
    {attribute_view_gui attribute=$teacher.main_node.data_map.experience}<br/><br/>
{/foreach}

Hope it helps.
Cheers.

Microblau SL
http://www.microblau.net

Xavier Dutoit

Monday 11 December 2006 8:10:41 am

Hi,

No need of the extra loop through the main node of the object,

{attribute_view_gui attribute=$teacher.data_map.name}<br/>

http://www.sydesy.com

Satheesh R

Tuesday 12 December 2006 2:13:47 am

Hi Jacobo Quiles, Xavier Dutoit

It works well, Thanks for the solutions

Thanks and regards
Satheesh R

Thanks and Regards
R Satheesh

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.