attribute_view_gui customized

Author Message

Fabien Scantamburlo

Wednesday 09 April 2008 2:48:48 am

Hi,

I'm trying to get related object information from an <i>ezcontentobjecttreenode</i>. For example, related <i>articles</i>.
I get information as following :

{if $node.data_map.related_articles.has_content}
<ul>
{foreach $node.data_map.related_articles.content.relation_list as $related_article}
<li><a href={$related_article.url_alias|ezurl}>{$related_ar.data_map.title.content}</a></li>
{/foreach}
{/if}

I can get the object title, but i can't get the url_alias cause $related_article is an object, not an <i>ezcontentobjecttreenode</i>.

However, a basic

{attribute_view_gui attribute=$node.data_map.related_articles}

return the list of related articles links with available url.(separate by <br/>)

How can i do to display my list of related article with my own html code ?

Thanks.

Fab.

Bruce Morrison

Wednesday 09 April 2008 3:07:26 am

Try

{if $node.data_map.related_articles.has_content}
<ul>
{foreach $node.data_map.related_articles.content.relation_list as $related_article}
<li><a href={$related_article.main_node.url_alias|ezurl}>{$related_ar.data_map.title.content}</a></li>
{/foreach}
{/if}

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Fabien Scantamburlo

Wednesday 09 April 2008 5:46:28 am

Thanks a lot, Bruce !

That's great.
However, is it possible to "select" which node i want to relate ?

My problem is some articles are published in several locations, and the <i>main_node</i> is not always the good one.

Thanks,

Fab.

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 19 2025 12:53:05
Script start
Timing: Jan 19 2025 12:53:05
Module start 'layout'
Timing: Jan 19 2025 12:53:05
Module start 'content'
Timing: Jan 19 2025 12:53:05
Module end 'content'
Timing: Jan 19 2025 12:53:05
Script end

Main resources:

Total runtime0.0206 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.0061 589.1563152.6250
Module start 'layout' 0.00610.0042 741.781339.4453
Module start 'content' 0.01030.0077 781.226689.4453
Module end 'content' 0.01800.0026 870.671934.3047
Script end 0.0206  904.9766 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002712.9272140.0002
Check MTime0.00115.1471140.0001
Mysql Total
Database connection0.00073.529010.0007
Mysqli_queries0.002411.821930.0008
Looping result0.00000.092610.0000
Template Total0.002210.810.0022
Template load0.00104.641310.0010
Template processing0.00136.101910.0013
Override
Cache load0.00042.155110.0004
General
dbfile0.003215.632180.0004
String conversion0.00000.047540.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