more related objects questions

Author Message

j jevack

Wednesday 09 November 2005 5:29:08 am

I have read much on the forums regarding related objects and I'm still having trouble understanding how to output related objects.

I have an article-type class which can have image objects related to it. I would like to display the related objects at the bottom of each article. I don't want to embed the images in the article text, just simply loop thru them and display them at the end of the article.

I have successfully accessed the related objects and can loop the array. I get the name of each object but cannot display the image. My code is:

{let vRelatedObjects=$node.object.related_contentobject_array}
{foreach $vRelatedObjects as $vMyObject}
name is: {$vMyObject.data_map.name.value}
image is: {content_view_gui content_object=$vMyObject.data_map.image}
{/foreach}
{/let}

Why doesn't the above display my image?

Regards,

Jason

Alexandre Abric

Wednesday 09 November 2005 5:39:14 am

Hi,

Try : {attribute_view_gui attribute=$vMyObject.data_map.image}

j jevack

Wednesday 09 November 2005 6:05:34 am

Greetings,

{attribute_view_gui attribute=$vMyObject.data_map.image} does not work either.

I guess i'm assuming that since i can access the related objects and display the name that I should be able to display the image. Is this incorrect?

Thanks,

Jason

Alexandre Abric

Wednesday 09 November 2005 6:21:54 am

have a look at :

{$vMyObject|attribute(show)}

If you can see the image attribute in the page, then the code above should work. If not, then you have to fetch the object, based on the node_id or the contentobject_id of $vMyObject.

j jevack

Wednesday 09 November 2005 7:16:25 am

{$vMyObject|attribute(show)} does provide the image attribute but {attribute_view_gui attribute=$vMyObject.image} provides no output.

I will try your sugestion to get the object id and then fetch that object.

Regards,

Jason

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

Main resources:

Total runtime0.0127 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.0049 588.1328151.2109
Module start 'layout' 0.00490.0019 739.343836.6641
Module start 'content' 0.00680.0045 776.007890.0313
Module end 'content' 0.01130.0013 866.039133.9922
Script end 0.0127  900.0313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002317.8761140.0002
Check MTime0.00108.1714140.0001
Mysql Total
Database connection0.00086.651410.0008
Mysqli_queries0.001814.415130.0006
Looping result0.00000.071410.0000
Template Total0.00108.010.0010
Template load0.00086.382710.0008
Template processing0.00021.600810.0002
Override
Cache load0.00064.468110.0006
General
dbfile0.00032.074380.0000
String conversion0.00000.047040.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