Category Seo Name Won't Accept Edit

Hi,



I just had to change the name of one of my categories, which wasn't a problem. However in the add-ons tab, SEO name will not accept the edit as I entered it. The old Category name was Karen Blandford and the new one is Karen Blandford Alderson. While trying to edit manually the SEO name insists on being “karen-blandford-alderson-en” when I save instead of just plain “karen-blandford-alderson”. Any insights appreciated.

This usually means you already have that name “karen-blandford-alderson” in the database. Use PHPMyAdmin or something to delete it from the database if you're sure you only want one instance.

Thanks. That was it. The full name was used as a brand name, the shorter one as an artist. I changed the artist as google search indicated the long version came up more for artist. So just the language code gets appended? Shouldn't be a problem, I'm thinking. Correct?

Yeah I think that's right–language code gets appended if you try to create a duplicate.

Appending the language code is not needed when “show language code in url” is ticked. The code gets appended twice.



domain.com/en/title-en



Why is that useful?

[quote name='Paul John' timestamp='1410261125' post='191760']

Appending the language code is not needed when “show language code in url” is ticked. The code gets appended twice.



domain.com/en/title-en



Why is that useful?

[/quote]



It means that the title SEO url is used for other object already

Thanks ecomlabs, I got that.



In my case, it is used by the same page in a different language, nowhere else. So I still do not see the point.

The language code is already there, appended to the TLD domain.com/de/



To avoid duplicate urls, I can understand it would put title-2 but not title-en.

With this behaviour, I will end up with urls filled with language codes all over the place when there is no need for a translation;

domain.com/en/cat1-en/subcat1-en/pagetitle1-en



Not very “friendly” if you ask me.

[quote name='Paul John' timestamp='1410278340' post='191786']

Thanks ecomlabs, I got that.



In my case, it is used by the same page in a different language, nowhere else. So I still do not see the point.

The language code is already there, appended to the TLD domain.com/de/



To avoid duplicate urls, I can understand it would put title-2 but not title-en.

With this behaviour, I will end up with urls filled with language codes all over the place when there is no need for a translation;

domain.com/en/cat1-en/subcat1-en/pagetitle1-en



Not very “friendly” if you ask me.

[/quote]



In this case you can edit the app/addons/seo/func.php file and replace:



if ($index == 1) {
$object_name = $object_name . SEO_DELIMITER . $lang_code;
} else {
$object_name = preg_replace("/-\d+$/", "", $object_name) . SEO_DELIMITER . $index;
}




with




$object_name = preg_replace("/-\d+$/", "", $object_name) . SEO_DELIMITER . $index;



In this case it will add index for the first match instead of the language code. Not tested!

1 Like

Wow, my next question/comment would be: “How to hack the SEO addon to change this behaviour?”.

Ecomlabs, you must be clairvoyant!



I will give it a try and report back.

ecomLabs, your hack worked. Instead of appending the language code, a number gets put in.



The behaviour would be optimal if the same seo name would be allowed as long as the language is different.

Just check for duplicates within the same language, else, leave alone.



thanks for your insights so far.

[quote name='Paul John' timestamp='1410380627' post='191906']

ecomLabs, your hack worked. Instead of appending the language code, a number gets put in.



The behaviour would be optimal if the same seo name would be allowed as long as the language is different.

Just check for duplicates within the same language, else, leave alone.



thanks for your insights so far.

[/quote]



Glad to hear that it solved your problem.