patch to make the "alias url" look better (readability / search engines)

Author Message

Ronnie Garcia

Wednesday 18 August 2004 3:13:26 pm

Hello,
I noticed that when eZ publish builds an "alias url", it stripped all special characters including accents to replace them with a "_".
I'm french and accents are really <b>common usage</b> here.

Nowadays, search engines (especially Google) give a considerable importance to the url of crawled pages and thats why i wanted to change this default behaviour.

I made a patch against eZURLAlias:: so that it does remove accents and convert ligatures to their 2-letters equivalent.

An url like :

index.php/site/pr_sentation_des_l_ments_de_mon_uvre

Where the title was "Présentation des éléments de mon ¼uvre" (some characters may have been dropped by your browser) would now be translated to :

index.php/site/presentation_de_mon_oeuvre

Witch can make a significant difference regarding to readability and search engines.

I can send the patch to anyone interrested. What is the official way to send a patch to the core team ?

Regards,
Ronnie Garcia.

kracker (the)

Wednesday 18 August 2004 3:35:15 pm

Why not simply package it and post it as a contribution as a solid first step?
http://ez.no/community/contributions

This way others can benefit from the patch right away without having to wait for it to be accepted and integrated into eZ publish.

You might also want to include some basic installation instructions and what licence your distributing the patch under (If your not sure about which licence I suggest the GNU GPL as it seems this would fall under the category of derived work of an existing GPL package).

Happy Hacking,
\\kracker
http://ezpub.co.uk/

Sole : Bottle Of Humans : Our Dirty Secret (Feat. Alias, Dose, & The Pedestrian)

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

Bård Farstad

Wednesday 18 August 2004 10:17:39 pm

There is actually functionality for this almost ready in the 3.5 development version. 3.5 will have support for this, the translation is configurable for the different locales.

--bård

Documentation: http://ez.no/doc

Ronnie Garcia

Thursday 19 August 2004 4:53:31 am

Glad to know.

And by the way, i saw that someone (Gunnstein Lye) had already posted a similar hack there :
http://ez.no/community/contributions/hacks/url_alias_transliteration

I will use mine (looks faster) until 3.5 is released.

Regards,
Ronnie Garcia.

Ronnie Garcia

Thursday 19 August 2004 5:59:35 am

Because this discussion is important, i would add some informations about search engines.
Several forum [1] seem to confirm that search engines (at least Google's based ones) dont treat "_" as a word separator.

Then i think it would be worth, while you're at it for 3.5, to change the default behaviour and replace any non-valid character into an hyphen (-) instead of an underscore (_).

[1] :
http://forums.digitalpoint.com/showthread.php?t=210
http://www.markcarey.com/googleguy-says/archives/discuss-googleguy-confirms-that-underscores-are-not-word-separators.html

Regards,
Ronnie Garcia.

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:36:31
Script start
Timing: Jan 18 2025 18:36:31
Module start 'layout'
Timing: Jan 18 2025 18:36:31
Module start 'content'
Timing: Jan 18 2025 18:36:32
Module end 'content'
Timing: Jan 18 2025 18:36:32
Script end

Main resources:

Total runtime1.5544 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 588.1719152.6563
Module start 'layout' 0.00630.0027 740.828139.5234
Module start 'content' 0.00891.5439 780.3516610.9141
Module end 'content' 1.55280.0015 1,391.265612.0781
Script end 1.5543  1,403.3438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2090160.0002
Check MTime0.00120.0800160.0001
Mysql Total
Database connection0.00180.114410.0018
Mysqli_queries1.491995.9788650.0230
Looping result0.00070.0440630.0000
Template Total1.520297.820.7601
Template load0.00200.126020.0010
Template processing1.518297.672820.7591
Template load and register function0.00020.014010.0002
states
state_id_array0.00130.083510.0013
state_identifier_array0.00190.122120.0009
Override
Cache load0.00170.1101460.0000
Sytem overhead
Fetch class attribute can translate value0.00080.049730.0003
Fetch class attribute name0.00150.099670.0002
XML
Image XML parsing0.00160.100630.0005
class_abstraction
Instantiating content class attribute0.00000.001070.0000
General
dbfile0.00110.0709250.0000
String conversion0.00000.000440.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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/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: 29
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs