How to fetch the data inside a 'reverse object'?

Author Message

Sam Wong

Friday 25 November 2005 6:23:21 am

Here's my problem...

{def $objects=fetch( 'content', 'reverse_related_objects', hash( object_id, $node.contentobject_id, attribute_identifier, 207 ) )}

{foreach $objects as $obj}
		{content_view_gui view=text_linked content_object=$obj}
{/foreach}

I tried to display most of content (author, title, intro, links) from a list of reverse objects without any success. I only got the code to display both links and topic. However, I'm so lost as to which code I have to use to retrieve the data inside. I couldn't find any useful examples to help me with that.

My 'article' class:
- title
- intro
- body
- image
- enable_comments

Any help is appreciated.

Sam Wong

Saturday 26 November 2005 7:41:07 am

Could anyone PLEASE provide any pointers? I'm begging you... :(

I'm totally lost as to how I can retrieve data. I searched everywhere in the documentation, and tried literally every example I could find from the templates. Unfortunately, I still couldn't display any attributes (author, title, intro) from my reverse objects.

Xavier Dutoit

Saturday 26 November 2005 8:05:35 am

In your foreach, put a {$obj|attribute(show,2)}, you'll find all the attributes you want.

X+

http://www.sydesy.com

Sam Wong

Saturday 26 November 2005 8:58:21 am

Thanks Xavier Dutoit. I found out about this code, but still couldn't display anything.

The worst part is I don't know where to start.

I'm pretty serious :( when I say ya i looked everywhere. Tried everything. None worked. I have some experience in OOP, but the syntax for the system is killing me.

I tried the following:
attribute_view_gui...
$obj.object.data_map.intro
$obj.object.intro
$obj.object.data_map.intro.content

and a bunch of other codes too. Sigh... sorry for the whining.

Sam Wong

Saturday 26 November 2005 11:00:55 am

Just want to say thanks. I finally got it to work.

<a href="{$obj.main_node.url_alias}"><big>{$obj.name}</big></a>
<br /><small>Posted on {$obj.published|l10n( 'date' )}
by {$obj.current.creator.name}</small>
<p />{$obj.contentobject_attributes.3.data_text}

Basically, it's relatively easy now that I figured out the structure.

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 04:28:47
Script start
Timing: Jan 31 2025 04:28:47
Module start 'layout'
Timing: Jan 31 2025 04:28:47
Module start 'content'
Timing: Jan 31 2025 04:28:47
Module end 'content'
Timing: Jan 31 2025 04:28:47
Script end

Main resources:

Total runtime0.0196 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.0068 588.2656151.2266
Module start 'layout' 0.00680.0036 739.492236.6797
Module start 'content' 0.01040.0074 776.171994.3125
Module end 'content' 0.01780.0018 870.484433.9922
Script end 0.0196  904.4766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002613.0681140.0002
Check MTime0.00115.8167140.0001
Mysql Total
Database connection0.00084.246010.0008
Mysqli_queries0.004120.883930.0014
Looping result0.00000.086210.0000
Template Total0.00146.910.0014
Template load0.00115.707410.0011
Template processing0.00021.150710.0002
Override
Cache load0.00084.241110.0008
General
dbfile0.002814.302580.0004
String conversion0.00000.055840.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