Forums / Setup & design / attribute_view_gui customized

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.