This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » Get URL aliases in a tpl (ez 4.x)
expandshrink

Get URL aliases in a tpl (ez 4.x)

Get URL aliases in a tpl (ez 4.x)

Thursday 28 February 2013 11:13:31 am - 3 replies

Hi,

Is it a way to get the URL aliases of a node in a template?
I'm not talking about the url_alias of the node but about the aliases defined in the backend with the view "content/urlalias/<nodeID>".

Thanks,

Nicolas

Thursday 28 February 2013 6:47:07 pm

Hi Nicolas,

Hope i'm not misunderstanding, but it looks that you want to get data from the content module and not from the treenode.

ie, current url is /content/view/full/123 : "content" is the module, "view" is a view within this module, "full" and "123" are two parameters.

In your module's view script, you can get the current module with $Params['Module'] and other params with $Params['ViewMode'] and $Params['NodeID'] (see kernel/content/view.php and kernel/classes/eznodeviewfunctions.php)

You also can get the current viewmode and node in a template file of content module with $viewmode, and sure, $node blunk.gif Emoticon

 

Hope it will help !

Thursday 28 February 2013 7:49:05 pm

I suspect you'll need to do this in php, Nicolas. Suggest you check how they do it in the admin interface, but a good start is looking at the eZURLAliasML php class.

Friday 01 March 2013 9:26:05 am

Thanks for your answers.
OK, I will create a custom TO to get the aliases through PHP.

Nicolas

expandshrink

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

36 542 Users on board!

Forums menu

Proudly Developed with from