Overriding URL aliases

Author Message

Ammar Ibrahim

Tuesday 21 November 2006 2:35:53 am

I'm playing a bit with url aliases. I have a bit of a problem, is there a way to override the default behaviour? Here's what I'm trying to acheive, and I think you should conisder having this option in the future, it can be very helpful.

Let's assume I create a new article, by default I get a URL similiar to this:
http://example.com/section/iraq_under_war

I want to have a different URL, as follows:
http://example.com/section/456-iraq_under_war

The only thing I added is the node id before the clean URL. There are many benefits to this, which I'm sure you know. Now the lookup for the article should happen on the ID only, anything that comes after it is ignored. This way I don't need to store any aliases in the database, and lookups can happen much faster. If the clean URL changed, I wouldn't have any problem, and there's no need to store the old alias...etc.

I had a chat with Bard, and he mentioned that I should do a bit of hacking to the code to acheive this as currently there is no way to do this cleanly in eZ.

Where should I start hacking? Any help is appreciated

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

Main resources:

Total runtime0.5922 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 587.9063152.6250
Module start 'layout' 0.00590.0026 740.531339.4297
Module start 'content' 0.00850.5822 779.9609402.3906
Module end 'content' 0.59070.0015 1,182.35168.1875
Script end 0.5922  1,190.5391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.5339160.0002
Check MTime0.00130.2135160.0001
Mysql Total
Database connection0.00080.130010.0008
Mysqli_queries0.553793.4848460.0120
Looping result0.00060.0967440.0000
Template Total0.562495.020.2812
Template load0.00230.391520.0012
Template processing0.560194.564120.2800
Template load and register function0.00030.047610.0003
states
state_id_array0.00070.112610.0007
state_identifier_array0.00080.127520.0004
Override
Cache load0.00190.3178110.0002
Sytem overhead
Fetch class attribute can translate value0.00070.111110.0007
Fetch class attribute name0.00070.114810.0007
XML
Image XML parsing0.00010.016510.0001
class_abstraction
Instantiating content class attribute0.00000.000510.0000
General
dbfile0.00070.1173100.0001
String conversion0.00000.001440.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/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: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs