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.

eZ debug

Timing: Jan 20 2025 17:21:00
Script start
Timing: Jan 20 2025 17:21:00
Module start 'layout'
Timing: Jan 20 2025 17:21:00
Module start 'content'
Timing: Jan 20 2025 17:21:02
Module end 'content'
Timing: Jan 20 2025 17:21:02
Script end

Main resources:

Total runtime1.3576 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 587.9219151.2109
Module start 'layout' 0.00620.0027 739.132836.6641
Module start 'content' 0.00891.3478 775.7969607.1016
Module end 'content' 1.35660.0009 1,382.898411.8438
Script end 1.3575  1,394.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2477160.0002
Check MTime0.00130.0980160.0001
Mysql Total
Database connection0.00080.062110.0008
Mysqli_queries1.308196.3575620.0211
Looping result0.00090.0654600.0000
Template Total1.324097.520.6620
Template load0.00220.159820.0011
Template processing1.321897.363420.6609
Template load and register function0.00020.016510.0002
states
state_id_array0.00090.064310.0009
state_identifier_array0.00270.200220.0014
Override
Cache load0.00180.1316210.0001
Sytem overhead
Fetch class attribute can translate value0.00090.063730.0003
Fetch class attribute name0.00110.082760.0002
XML
Image XML parsing0.00280.203130.0009
class_abstraction
Instantiating content class attribute0.00000.000960.0000
General
dbfile0.00240.1776220.0001
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs