Forums / General / What is the deal with Object Relations?

What is the deal with Object Relations?

Author Message

Clemens T

Wednesday 02 February 2005 5:55:45 am

Heya all,

I'm an experienced PHP-Programmer, yet still new to eZ Publish. What is the deal with Object Relations? I created an article and added a few related objects to it. I assumed there would be links in the article to these related items, but my assumptions were incorrect. What are Object Relations in the eZ Publish context?

Thanks a lot for your assistance,
Clemens

Frederik Holljen

Wednesday 02 February 2005 5:57:47 am

An object relation is an abstract relation to another object. In your template you can access this relation (and the related object) and choose to display it in whatever way you like (e.g a link, an image, the complete object etc.)

Clemens T

Wednesday 02 February 2005 6:22:46 am

That sounds like a good programming technique! Could you point me to a few tutorials on how to handle these Object Relations in a template -- or just explain it to me briefly, please?
Thank you!
Clemens

Frederik Holljen

Wednesday 02 February 2005 6:31:24 am

You access it similarly to any other attribute of your content objects (using data_map.name_of_your_relation_attribute). You can use {$var_name|attribute(show)} on it to see what it contains.
Usually you either display the contents of the related object directly using your own HTML markup or you use one of the GUI functions like attribute_view_gui or content_view_gui.

Clemens T

Wednesday 02 February 2005 2:30:23 pm

Ok, thanks. Now the next question:

How can I override the template, because the folder structure doesn't make much sense to me -- I can't get it to work by placing a file in the /override/ dir. That's all you have to do right? Could you illustrate the usage of /override/ with one tmpl?

Great!

eZ debug

Timing: Jan 19 2025 00:14:29
Script start
Timing: Jan 19 2025 00:14:29
Module start 'content'
Timing: Jan 19 2025 00:14:31
Module end 'content'
Timing: Jan 19 2025 00:14:31
Script end

Main resources:

Total runtime1.2875 sec
Peak memory usage4,096.0000 KB
Database Queries200

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 587.7266180.8359
Module start 'content' 0.00511.1035 768.5625532.2344
Module end 'content' 1.10860.1788 1,300.7969337.3750
Script end 1.2875  1,638.1719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.2925210.0002
Check MTime0.00150.1128210.0001
Mysql Total
Database connection0.00070.057710.0007
Mysqli_queries1.193092.65692000.0060
Looping result0.00270.21131980.0000
Template Total1.259597.820.6297
Template load0.00210.162820.0010
Template processing1.257397.655520.6287
Template load and register function0.00030.022810.0003
states
state_id_array0.00080.063110.0008
state_identifier_array0.00080.059320.0004
Override
Cache load0.00170.1324220.0001
Sytem overhead
Fetch class attribute can translate value0.00190.150430.0006
Fetch class attribute name0.00170.132260.0003
XML
Image XML parsing0.00160.123430.0005
class_abstraction
Instantiating content class attribute0.00000.001670.0000
General
dbfile0.00760.5874270.0003
String conversion0.00000.000530.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/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: 18
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs