Forums / Setup & design / Object relations (datatype) does it work?

Object relations (datatype) does it work?

Author Message

Atle Enersen

Tuesday 08 April 2003 11:18:43 pm

I created two classes, both with a datatype "Object relation". First I related object "B" into object "A", tried all examples found in the tpl's (both for related and child items) without any luck. Then I related object "A" into object "B" and tried the same all over again (viewing both objects) keeping the first relationship. No luck.

No, there is no caching at the site, and paranoid as I am I cleared the cache manually to be sure.

Of corse it is possible I did not use the correct code-snipplet(s), but... So the question remains, are object relations working or am I doing something wrong?

...and if it is working, it would be nice with at code-snipplet that eZ-crew knows in fact are working :-)

It's eZ3 final on Apache 2.*/Linux btw.

\\atle\\
--

Bård Farstad

Friday 11 April 2003 6:55:13 am

Object relations does work in 3.0. You can see it in action here at ez.no. The "last forum messages", banners and "latest news" are all embeded related objects.

If you take a look at the standard templates, full.tpl, you will see that there is a block for the related objects. This block will show all objects which is related to the current object.

--bård

Documentation: http://ez.no/doc

Atle Enersen

Monday 14 April 2003 2:23:35 am

Well, I actually did that, and I did it again just to ensure that I did'nt do any mistakes. It still is'nt working. This is (one of the) code(s) used...:

{default content_version=$node.contentobject_version_object
node_name=$node.name}
....

{section name=Object loop=$content_version.related_contentobject_array show=$content_version.related_contentobject_array}
<div class="block">
{content_view_gui view=text_linked content_version=$Object:item}
</div>
{/section}

\atle\
--

Bård Farstad

Monday 14 April 2003 2:40:57 am

Try this:

{section name=Related loop=$node.object.related_contentobject_array}
{$Related:item.name}
{/section}

It should work, if you put it in your override for full.tpl. I just tested it with my installation. I used it in full_class_1.tpl.

--bård

Documentation: http://ez.no/doc

eZ debug

Timing: Jan 18 2025 01:56:14
Script start
Timing: Jan 18 2025 01:56:14
Module start 'content'
Timing: Jan 18 2025 01:56:15
Module end 'content'
Timing: Jan 18 2025 01:56:15
Script end

Main resources:

Total runtime1.0737 sec
Peak memory usage4,096.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0076 588.9453180.8281
Module start 'content' 0.00760.9186 769.7734557.1563
Module end 'content' 0.92620.1475 1,326.9297336.7422
Script end 1.0737  1,663.6719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00430.3978210.0002
Check MTime0.00150.1405210.0001
Mysql Total
Database connection0.00130.119510.0013
Mysqli_queries0.987091.91851970.0050
Looping result0.00200.18671950.0000
Template Total1.026995.620.5134
Template load0.00210.197020.0011
Template processing1.024895.438320.5124
Template load and register function0.00020.022510.0002
states
state_id_array0.00140.130310.0014
state_identifier_array0.00150.140620.0008
Override
Cache load0.00170.1624350.0000
Sytem overhead
Fetch class attribute can translate value0.00220.209230.0007
Fetch class attribute name0.00110.106250.0002
XML
Image XML parsing0.00280.256430.0009
class_abstraction
Instantiating content class attribute0.00000.001460.0000
General
dbfile0.01040.9708280.0004
String conversion0.00000.000630.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 22
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs