You are here:  » special characters in category links


special characters in category links

Submitted by acom on Wed, 2010-03-10 09:41 in

Hi David,
I would like to remove from my links the special characters and Upper characters.
Currently my category links are like this :
mysite.com/Caméra
I would like instead to have links like this :
mysite.com/camera

There is my project (of php beginner) :
I thought of adding in the product database a new category field, called "category_simplified_name".
For instance :
Category name : Caméra
Category simplifed name : camera
To build the category simplified name I thought of using the category name, then encode it in iso, then use a replace function to remove the special characters, and then a lower case function.

Then i would use the category simplifed name in the links as an ID to get the category info.

Do you thinks this would be possible ? Could you give me some indications on to which file i need to modify in order to import the category simplified name? And on which file
Best regards,
Frédéric

Submitted by support on Wed, 2010-03-10 13:37

Hello Frédéric,

Do you mean you only want to remove them from the URL, but the actual category field you want to keep the original name?

Cheers,
David.

Submitted by acom on Wed, 2010-03-10 14:16

Hi David,
Yes that's exactly what I would like.
Best regards,
Frédéric

Submitted by support on Wed, 2010-03-10 14:22

Hi Frédéric,

There's quite a few changes required to do this, I'll have a go for you if you could email me

includes/admin.php
categories.php
search.php

And if you could also let me know a list of all the character translations you need, e.g.

é => e

...that would help...!

Cheers,
David.

Submitted by george-p on Sat, 2016-11-05 23:15

Hello David

i'm using pricetapestry 15/09A ,
how i can remove all Greek characters from urls, so that urls have only latin

thanks

Submitted by support on Mon, 2016-11-07 10:04

Hello George,

With the iconv library now commonly installed the tidiest solution is described in this comment which uses iconv("UTF-8","ASCII//TRANSLIT",$text) to convert non-ASCII characters to their latin equivalent.

Cheers,
David.
--
PriceTapestry.com

Submitted by george-p on Tue, 2016-12-06 20:38

Hello David

i saw your reply now

i tried and now removes all greek characters from urls, keep only latin characters

maybe i do something wrong?

Submitted by support on Wed, 2016-12-07 11:01

Hello George,

Did you include the new line in config.php

  setlocale(LC_ALL,"en_US.utf8");

If not, try the above first (changes will only become apparent after import), otherwise if already in place, try instead using:

  setlocale(LC_ALL,"el_GR.utf8");

Hope this helps!

Cheers,
David.
--
PriceTapestry.com