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.