Forums / Setup & design / Getting urls for related objects...

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Getting urls for related objects...

Author Message

Ben Pirt

Wednesday 30 July 2003 3:46:59 am

Hi all,
I have a number of related objects to a node which I want to provide links to using the ezroot/nice urls method, but I can't seem to access the url_alias variable for these objects. I have the following code:

{section name=Related loop=$node.object.related_contentobject_array}
<a href="{$Related:item.url_alias|ezroot}">{$Related:item.name}</a>
{/section}

which shows the name of the objects fine, but I can't get the correct url to display properly. I'm sure I'm missing something completely obvious here, but I feel like i'm banging my head against a brick wall at the moment. Any help would be massively appreciated.

All the best,

Ben Pirt

Bjørn Kaarstein

Wednesday 30 July 2003 3:52:19 am

Maybe it's possible to check {$Related:item|attribute(show)} to check what you have access to...

Regards Bjørn

Ben Pirt

Wednesday 30 July 2003 4:32:05 am

Thanks Bjørn,
that was exactly what I was looking for. Makes it much easier to work things out for yourself with that.
Cheers,
Ben

PS for those interested the correct access was:

{section name=Related loop=$node.object.related_contentobject_array}
<a href={concat("/",$Related:item.main_node.url_alias)|ezroot}>{$Related:item.name}</a>
{/section}