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

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...