Forums / Setup & design / using translated URLs in templates

using translated URLs in templates

Author Message

Marko Žmak

Monday 08 May 2006 3:40:14 am

I have setup some url translations (regular and wildcard also) and it's working but I would like to know how can I use this virtual URLs in templates. Here's an example:

Real url: /ugly_url/*
Virtual url: /nice_url/{1}

so when I write in my browser:

/nice_url/example

the page:

/ugly_url/example

is shown, and the adres of:

/nice_url/example

is shown in the browser. And that's OK. But when I create a link to this page in template (by using $node.url_alias) I get the link to:

/ugly_url/example

What should I do to produce the link to the virtual url in templates?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Softriva .com

Sunday 18 February 2007 11:03:06 pm

Terry

Did you find an answer to this issue?

Please post the solution if available.

Thx
OOzy

Marko Žmak

Monday 19 February 2007 12:16:52 am

No, unfortunately I did not find any answers to this. No one told me even if this is possible or not.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Claudia Kosny

Monday 19 February 2007 1:38:11 pm

Hi OOzy and Marko

Have you ever tried just writing a template operator that calls eZURLAlias::fetchByDestinationURL? I am not sure whether would do exactly what you need, but with this you can fetch the nice url that leads to the source url. Of course this means one extra query per url :-(

Claudia