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!

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 31 2025 06:24:44
Script start
Timing: Jan 31 2025 06:24:44
Module start 'layout'
Timing: Jan 31 2025 06:24:44
Module start 'content'
Timing: Jan 31 2025 06:24:44
Module end 'content'
Timing: Jan 31 2025 06:24:44
Script end

Main resources:

Total runtime0.0142 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 588.1484151.2109
Module start 'layout' 0.00540.0023 739.359436.6484
Module start 'content' 0.00770.0049 776.007894.1250
Module end 'content' 0.01270.0015 870.132833.9922
Script end 0.0142  904.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002316.2928140.0002
Check MTime0.00107.3256140.0001
Mysql Total
Database connection0.00085.729510.0008
Mysqli_queries0.003021.466130.0010
Looping result0.00010.494010.0001
Template Total0.00128.310.0012
Template load0.00096.413310.0009
Template processing0.00031.818010.0003
Override
Cache load0.00074.756610.0007
General
dbfile0.00106.715780.0001
String conversion0.00000.028640.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