How to display related objects on a custom template ?

Author Message

Xavier Dutoit

Friday 10 January 2003 2:20:49 am

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 ;)

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 ?

http://www.sydesy.com

sergey podlesnyi

Tuesday 14 January 2003 4:07:13 am

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 ;)
>
> 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 ?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 21:10:13
Script start
Timing: Jan 30 2025 21:10:13
Module start 'layout'
Timing: Jan 30 2025 21:10:13
Module start 'content'
Timing: Jan 30 2025 21:10:13
Module end 'content'
Timing: Jan 30 2025 21:10:13
Script end

Main resources:

Total runtime0.0264 sec
Peak memory usage8,192.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 588.3828151.2422
Module start 'layout' 0.00550.0044 739.6250220.7500
Module start 'content' 0.00990.0149 960.3750997.8672
Module end 'content' 0.02480.0015 1,958.242233.9922
Script end 0.0264  1,992.2344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002810.6420140.0002
Check MTime0.00114.2841140.0001
Mysql Total
Database connection0.00072.777510.0007
Mysqli_queries0.00269.849030.0009
Looping result0.00000.048810.0000
Template Total0.00114.210.0011
Template load0.00093.247210.0009
Template processing0.00030.973710.0003
Override
Cache load0.00062.163310.0006
General
dbfile0.00165.891980.0002
String conversion0.00000.025340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs