how to get url_alias in php script?

Author Message

Douglas Hammond

Wednesday 14 May 2008 2:36:41 pm

I need to get the url of a ezContentObject in php.

How do I get the url_alias like you do in a template?

Felix Laate

Wednesday 14 May 2008 3:33:06 pm

Hi Douglas,

if you check out the API docs at http://pubsvn.ez.no, you can see that this class has a method
<i>mainNode()</i> which returns the main node of the object. This node i an instance of the eZContentObjectTreeNode class which has the method </i>urlAlias.

Also usefull is the <i>fetchDataMap</i>method, that according to the API is <i>a map with all the content object attributes where the keys are the attribute identifiers.</i>

Hope this helps!

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Douglas Hammond

Wednesday 14 May 2008 5:47:14 pm

Thank you, that helps wonders.

Now all I have to do is lookup ezUrl in the api.

Thanks again

Maxime Thomas

Wednesday 13 August 2008 2:52:40 am

You may try a :

eZURI::transformURI(url);

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.