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

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 21 2025 17:15:19
Script start
Timing: Jan 21 2025 17:15:19
Module start 'layout'
Timing: Jan 21 2025 17:15:19
Module start 'content'
Timing: Jan 21 2025 17:15:20
Module end 'content'
Timing: Jan 21 2025 17:15:20
Script end

Main resources:

Total runtime1.1720 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.0049 589.1484151.2109
Module start 'layout' 0.00490.0028 740.359436.6484
Module start 'content' 0.00771.1635 777.0078603.1797
Module end 'content' 1.17120.0008 1,380.187511.8438
Script end 1.1720  1,392.0313 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2665160.0002
Check MTime0.00120.1025160.0001
Mysql Total
Database connection0.00060.053610.0006
Mysqli_queries1.123695.8651620.0181
Looping result0.00060.0528600.0000
Template Total1.140797.320.5703
Template load0.00190.160720.0009
Template processing1.138897.161420.5694
Template load and register function0.00010.010310.0001
states
state_id_array0.00100.088810.0010
state_identifier_array0.00180.155720.0009
Override
Cache load0.00160.1372290.0001
Sytem overhead
Fetch class attribute can translate value0.00090.077030.0003
Fetch class attribute name0.00110.092350.0002
XML
Image XML parsing0.00060.053730.0002
class_abstraction
Instantiating content class attribute0.00000.001260.0000
General
dbfile0.00060.0519180.0000
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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs