getting url alias of a node only knowing the node's ID

Author Message

Carlos Campderrós

Thursday 03 August 2006 1:50:30 pm

Hi!

I'm doing the navigation list of my site and I would like to get the URL of a node, only knowing this node ID. For every item of the list, I've got something similar to:

{def $item = hash(
    "text_to_show", "foo bar",
    "nodeID", 666
)
}

And I want to format it like this:

<li><a href={<i>getNodeByID($item.nodeID).url_alias</i>|ezurl}>{$item.text_to_show}</a></li>

I don't know the piece of code to substitute the <i>getNodeById</i>.

Thanks in advance.

Kristof Coomans

Thursday 03 August 2006 11:05:47 pm

Hello Carlos

You can use the content/node fetch function: http://ez.no/doc/ez_publish/technical_manual/3_8/reference/modules/content/fetch_functions/node

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Carlos Campderrós

Friday 04 August 2006 10:11:36 am

Oh thanks. I didn't think of that althought I knew the node option of the fetch function. Must not work til late...

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 31 2025 04:17:58
Script start
Timing: Jan 31 2025 04:17:58
Module start 'layout'
Timing: Jan 31 2025 04:17:58
Module start 'content'
Timing: Jan 31 2025 04:17:58
Module end 'content'
Timing: Jan 31 2025 04:17:58
Script end

Main resources:

Total runtime0.0150 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.3750151.2422
Module start 'layout' 0.00500.0027 739.617236.6953
Module start 'content' 0.00770.0060 776.312590.2031
Module end 'content' 0.01370.0013 866.515629.9922
Script end 0.0150  896.5078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002416.0541140.0002
Check MTime0.00117.2492140.0001
Mysql Total
Database connection0.00095.966010.0009
Mysqli_queries0.002013.142430.0007
Looping result0.00000.166310.0000
Template Total0.00106.610.0010
Template load0.00085.023410.0008
Template processing0.00021.541410.0002
Override
Cache load0.00053.415510.0005
General
dbfile0.001711.089380.0002
String conversion0.00000.072940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs