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

eZ Community » Forums » Install & configuration » How to display related objects on a...
expandshrink

How to display related objects on a custom template ?

How to display related objects on a custom template ?

Friday 10 January 2003 11:20:49 am - 1 reply

Hi all,

I've installed and discovered the lastest beta during the Xmas holidays. I'm amazed how clever it is. I remembered all the discussion we've had on the dev mailing list since the 2.x days... and you made our dreams come true !

I've no doubt anymore that santa klaus lives in norvay, and he belongs to the ez crew blunk.gif Emoticon

Ok, back to my template problem :

I'd like to customize the full.tpl view for a specific class, display its attributes and its related objects (therefore creating a /design/xxx/templates/node/view/full_class_nn.tpl )

In the template file, how do I access related objects ?

I've tried several attributes, like {$node.object.data_map.related_contetobject_array} on a sectoin loop, but I haven't managed to get the related objects.

Are they already loaded somewhere in the $node attribute ?

How to list all the attributes on this $node element ?

Should I try to let related= fetch ('content', 'list', ???) them ?

Thanks in advance for any hint, I'm afraid a need a hand after a sleepness night...

Xavier

P.S. Is is possible to add an extra param on the url to force ez to rebuild the cache ?

Tuesday 14 January 2003 1:07:13 pm

Hi Xavier,

I found a solution to display related objects - go to
design/user/override/templates/content/view
and you will see "embed" templates there. Put your own template embed_class_5.tpl where 5=id of related object class. I used line_class_5.tpl copy to start with, and it worked.

How do you add related objects to master object? In my installation data entry does not work - I select an object that I want to attach as related, but when press "Send for publishing" it says "Input does not validate". I had to use XML-text data field instead of related object, and paste <object> tag there (embed_ template works for this solution).

Cheers!

Sergey

> Hi all,
>
> I've installed and discovered the lastest beta during the
> Xmas holidays. I'm amazed how clever it is. I remembered all
> the discussion we've had on the dev mailing list since the
> 2.x days... and you made our dreams come true !
>
> I've no doubt anymore that santa klaus lives in norvay, and
> he belongs to the ez crew blunk.gif Emoticon
>
> Ok, back to my template problem :
>
> I'd like to customize the full.tpl view for a specific
> class, display its attributes and its related objects
> (therefore creating a
> /design/xxx/templates/node/view/full_class_nn.tpl )
>
> In the template file, how do I access related objects ?
>
> I've tried several attributes, like
> {$node.object.data_map.related_contetobject_array} on a
> sectoin loop, but I haven't managed to get the related
> objects.
>
> Are they already loaded somewhere in the $node attribute ?
>
> How to list all the attributes on this $node element ?
>
> Should I try to let related= fetch ('content', 'list', ???)
> them ?
>
> Thanks in advance for any hint, I'm afraid a need a hand
> after a sleepness night...
>
> Xavier
>
> P.S. Is is possible to add an extra param on the url to
> force ez to rebuild the cache ?

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from