Conevrt /content/view/full/node_id to nice url

Author Message

Softriva .com

Saturday 10 July 2010 12:25:53 am

Hello

If I have a content/view/full/node_id how can I make it show the urlalias. For example: if node # 233 is for aboutus

<a href={"content/view/full/233"|ezurl}>test</a>

does not show

<a href="/aboutus">test</a>

it shows as

<a href="/content/view/full/233">test</a>

TIA

Ivo Lukac

Saturday 10 July 2010 1:36:09 am

Get the node with fetch function and you will have the name of the node also:

{def $n = fetch(content,node,hash(node_id,233))}
<a href={$n.url_alias|ezurl}>{$n.name|wash}</a>
{undef $n}

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

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 18 2025 04:06:10
Script start
Timing: Jan 18 2025 04:06:10
Module start 'layout'
Timing: Jan 18 2025 04:06:10
Module start 'content'
Timing: Jan 18 2025 04:06:11
Module end 'content'
Timing: Jan 18 2025 04:06:11
Script end

Main resources:

Total runtime1.5903 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 589.1641152.6406
Module start 'layout' 0.00520.0031 741.804739.4766
Module start 'content' 0.00831.5803 781.2813526.6797
Module end 'content' 1.58860.0016 1,307.96098.1250
Script end 1.5902  1,316.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2232160.0002
Check MTime0.00160.0979160.0001
Mysql Total
Database connection0.00060.040310.0006
Mysqli_queries1.535196.5312540.0284
Looping result0.00070.0425520.0000
Template Total1.555597.820.7777
Template load0.00210.131020.0010
Template processing1.553497.680620.7767
Template load and register function0.00020.010510.0002
states
state_id_array0.00150.092410.0015
state_identifier_array0.00340.214020.0017
Override
Cache load0.00170.1073150.0001
Sytem overhead
Fetch class attribute can translate value0.00060.039620.0003
Fetch class attribute name0.00200.124530.0007
XML
Image XML parsing0.00070.043620.0003
class_abstraction
Instantiating content class attribute0.00000.000730.0000
General
dbfile0.00100.0639170.0001
String conversion0.00000.000540.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/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
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs