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

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.

eZ debug

Timing: Jan 18 2025 18:19:53
Script start
Timing: Jan 18 2025 18:19:53
Module start 'content'
Timing: Jan 18 2025 18:19:54
Module end 'content'
Timing: Jan 18 2025 18:19:54
Script end

Main resources:

Total runtime0.9004 sec
Peak memory usage4,096.0000 KB
Database Queries202

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 587.9844180.7969
Module start 'content' 0.00650.7930 768.7813616.0234
Module end 'content' 0.79950.1009 1,384.8047337.3516
Script end 0.9004  1,722.1563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.4522210.0002
Check MTime0.00150.1687210.0001
Mysql Total
Database connection0.00090.097410.0009
Mysqli_queries0.829992.16792020.0041
Looping result0.00150.16842000.0000
Template Total0.859395.420.4297
Template load0.00270.303120.0014
Template processing0.856695.127920.4283
Template load and register function0.00010.014210.0001
states
state_id_array0.00090.097810.0009
state_identifier_array0.00240.267820.0012
Override
Cache load0.00240.2713460.0001
Sytem overhead
Fetch class attribute can translate value0.00130.139940.0003
Fetch class attribute name0.00080.091570.0001
XML
Image XML parsing0.00160.175140.0004
class_abstraction
Instantiating content class attribute0.00000.001170.0000
General
dbfile0.00410.4572360.0001
String conversion0.00000.003430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 29
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs