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

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 18 2025 05:06:23
Script start
Timing: Jan 18 2025 05:06:23
Module start 'layout'
Timing: Jan 18 2025 05:06:23
Module start 'content'
Timing: Jan 18 2025 05:06:23
Module end 'content'
Timing: Jan 18 2025 05:06:23
Script end

Main resources:

Total runtime0.8870 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0104 588.0313152.6406
Module start 'layout' 0.01040.0039 740.671939.4766
Module start 'content' 0.01430.8711 780.1484552.0625
Module end 'content' 0.88540.0015 1,332.210912.1250
Script end 0.8869  1,344.3359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3865160.0002
Check MTime0.00140.1537160.0001
Mysql Total
Database connection0.00170.190510.0017
Mysqli_queries0.832293.8223600.0139
Looping result0.00060.0635580.0000
Template Total0.851396.020.4257
Template load0.00190.212920.0009
Template processing0.849495.763420.4247
Template load and register function0.00010.012510.0001
states
state_id_array0.00080.085010.0008
state_identifier_array0.00080.094820.0004
Override
Cache load0.00140.1606350.0000
Sytem overhead
Fetch class attribute can translate value0.00060.070420.0003
Fetch class attribute name0.00110.125650.0002
XML
Image XML parsing0.00050.056020.0002
class_abstraction
Instantiating content class attribute0.00000.001960.0000
General
dbfile0.00080.0892170.0000
String conversion0.00000.001540.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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