Nice URL Delimiter: Change _ to -

Author Message

Alex Jones

Wednesday 10 September 2003 3:28:32 pm

Is it possible to change the use of underscores to dashes in nice URLs?

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Gunnstein Lye

Thursday 11 September 2003 4:14:07 am

There is no config option for this. You must do a change in kernel/classes/ezcontentobjecttreenode.php. In the pathWithNames() function you will find two preg_replace expressions. Change underscore to - in the second array argument in both preg_replace calls. Then rerun update/common/scripts/updateniceurls.php.

Alex Jones

Friday 12 September 2003 6:59:44 am

Thanks Gunnstein!

I'm not sure if I want to make the change badly enough to tinker with code that may be overwrittein in future upgrades. I have to keep track of enough changes as it is. :) It would be nice if future versions of eZ publish provided this as a setting during setup or within the site.ini as the URLs delimiters can have a direct impact on search engine ranking.

Thanks again,

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Mark Marsiglio

Tuesday 03 April 2007 10:43:10 am

Has anyone been able to find where this moved to in the 3.7, 3.8 or 3.9 versions? It is no longer in the ezcontentobjecttreenode.php that I can see.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Kristof Coomans

Tuesday 03 April 2007 11:22:54 am

Hi Mark

It is converted by eZ's transliteration system ( http://ezpedia.org/wiki/en/ez/transliteration ), in eZURLAlias::convertToAlias. The different commands are listed in transform.ini. The one you're looking for is url_cleanup. At the end, you'll have to look at the top of eZCodeMapper::generateCommandCode and eZCodeMapper::executeCommandCode, where preg_replace is transforming your url.

Good luck!

<b>Edit:</b> apparently this question has been answered before: http://ez.no/community/forum/general/transformation_url_transliteration. I did make a nice trip however through the kernel and lib to find it out :-)

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Nabil Alimi

Tuesday 03 April 2007 1:53:54 pm

And it seems that is has been done already : http://www.premiere.fr/premiere/cinema

(Not by us :)

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

Damien Pitard

Monday 02 July 2007 3:46:59 pm

"This feature will be part of up-coming eZ Publish 3.10 release. User can define whatever separator want in url alias." by Lukasz Serwatka

seen on http://issues.ez.no/IssueView.php?Id=11063&activeItem=1

Damien Pitard | Prisma Presse

Robert G.

Sunday 23 December 2007 11:07:38 am

Hi,

i use ezpublish 3.9.4 and i have appplied the patch for dashed url ... now how can I update all existing objects? Launching /bin/php/updateniceurls.php url are not updated .

Thx

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 31 2025 01:24:57
Script start
Timing: Jan 31 2025 01:24:57
Module start 'layout'
Timing: Jan 31 2025 01:24:57
Module start 'content'
Timing: Jan 31 2025 01:24:57
Module end 'content'
Timing: Jan 31 2025 01:24:57
Script end

Main resources:

Total runtime0.0216 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.1328151.2109
Module start 'layout' 0.00500.0042 739.3438220.7031
Module start 'content' 0.00910.0109 960.04691,005.7109
Module end 'content' 0.02010.0015 1,965.757841.9922
Script end 0.0215  2,007.7500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002712.6691140.0002
Check MTime0.00115.1383140.0001
Mysql Total
Database connection0.00083.870910.0008
Mysqli_queries0.002411.192830.0008
Looping result0.00000.110510.0000
Template Total0.00104.510.0010
Template load0.00073.415610.0007
Template processing0.00021.043110.0002
Override
Cache load0.00052.420010.0005
General
dbfile0.00031.173580.0000
String conversion0.00000.040940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs