Forums / Install & configuration / How to display related objects on a custom template ?

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 ?

eZ debug

Timing: Jan 18 2025 02:50:03
Script start
Timing: Jan 18 2025 02:50:03
Module start 'content'
Timing: Jan 18 2025 02:50:04
Module end 'content'
Timing: Jan 18 2025 02:50:04
Script end

Main resources:

Total runtime0.9930 sec
Peak memory usage4,096.0000 KB
Database Queries191

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 589.0938180.8047
Module start 'content' 0.00640.8360 769.8984538.5703
Module end 'content' 0.84240.1505 1,308.4688332.7500
Script end 0.9929  1,641.2188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00450.4549210.0002
Check MTime0.00180.1822210.0001
Mysql Total
Database connection0.00070.071610.0007
Mysqli_queries0.908691.50051910.0048
Looping result0.00190.19371890.0000
Template Total0.961196.820.4805
Template load0.00270.267020.0013
Template processing0.958496.515420.4792
Template load and register function0.00010.009610.0001
states
state_id_array0.00170.169810.0017
state_identifier_array0.00100.098320.0005
Override
Cache load0.00230.2346630.0000
Sytem overhead
Fetch class attribute can translate value0.00120.124330.0004
Fetch class attribute name0.00130.133630.0004
XML
Image XML parsing0.00080.080130.0003
class_abstraction
Instantiating content class attribute0.00000.000630.0000
General
dbfile0.00760.7624270.0003
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs