Share » Forums » Developer » How to get 'url' of an object in...

How to get 'url' of an object in chosen language version.

How to get 'url' of an object in chosen language version.

Tuesday 06 October 2009 2:54:23 am - 1 reply

Author Message

Piotrek Karaƛ

Wednesday 07 October 2009 12:55:07 am

I'll extend this question with another example. Node $node has two translations with two different object names that should result in two different URL aliases. URL translations are enabled (version 4.2, default config):

<?php
$node = eZContentObjectTreeNode::fetch( 67, 'pol-PL' ); //default lang
var_dump( $node->urlAlias() );
$node = eZContentObjectTreeNode::fetch( 67, 'eng-US' );
var_dump( $node->urlAlias() );
?>

The above code returns two differently populated $node objects, but the urlAlias() method returns the same value - why? Is it because it always returns a valid URL alias based on environment (current siteaccess) settings?

Since not the above, what would be the way to fetch URL aliases for different translations of a node?

Thanks,
Piotrek

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu