We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Tome Module - Replacing URL underscores with dashes

Development and Programming

Leevi Graham's avatar
Leevi Graham
1,143 posts
17 years ago
Leevi Graham's avatar Leevi Graham

Hey All,

Does anyone know if you can replace the underscores in the urls generated with Tome with dashes?

Ex: http://yourwebsite.com/contact_us –> http://yorwebsite/contact-us

Cheers

       
Gabriel's avatar
Gabriel
130 posts
17 years ago
Gabriel's avatar Gabriel

Edit following fies (changing “_” to “-“):

ext.tome.php

Line 162:

if($c['cat_description'] == '') $c['cat_description'] = strtolower(preg_replace(array("/(?:^[^a-zA-Z0-9_-]+|[^a-zA-Z0-9_-]+$)/", "/[^a-zA-Z0-9_-]+/"), array("", "_"), $c['cat_name']));

change to

if($c['cat_description'] == '') $c['cat_description'] = strtolower(preg_replace(array("/(?:^[^a-zA-Z0-9_-]+|[^a-zA-Z0-9_-]+$)/", "/[^a-zA-Z0-9_-]+/"), array("", "-"), $c['cat_name']));

mcp.tome.php

Line 102:

array("", "_"),

change to

array("", "-"),

pi.static_tome_path.php

Line 77:

array("", "_"),

change to

array("", "-"),
       
Leevi Graham's avatar
Leevi Graham
1,143 posts
17 years ago
Leevi Graham's avatar Leevi Graham

Thanks Gabriel,

I’ll try the update now. It would be great if Mark could add this into the next version as an option 😉

Cheers

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.