News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Comma in alias

Started by sandomatyas, November 01, 2017, 05:20:20 AM

Previous topic - Next topic

sandomatyas

When I create new categories VM 3.2.4 doesn't remove commas from the alias field which breaks my urls.

sandomatyas


Milbo

commas do not break urls!
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Jörgen

Yes, commas are allowed in urls but they can make them look visually strange. Although allowed, there is good reason to stay away from commas. Perhaps they should be translated to '-'. Or you could simply not use commas in categories and product names? I have no definite solution to this.
Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Jörgen

Sounds like a good idea :)
Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

sandomatyas


Ventsi Genchev

This problem continues to exist. If you put a comma in the name of the product, it does not transform into a dash.

Do I miss something or still have no solution?
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

beny.rfg

Hi there,

I have the same problem, how can I fix it? Moreover, if I together set in virtuemart.cfg "transliterateSlugs=1" (because I need remove diacritics from url), comma is replaced to "%2C" and product url is crashed (404).

1. original alias: /bio-kapsička-jablko,-karotka-ovko-90-g
2. with "transliterateSlugs=1": /bio-kapsicka-jablko%2C-karotka-ovko-90-g,
3. I need this: /bio-kapsicka-jablko-karotka-ovko-90-g

Thanks, Petr

diri

@benny.rfg:

Please give a hint for me how system should be able to find the link you want to see when somebody clicks instead of real link you typed (with comma).

For me it look like you want a third stage for having a second alias.

Currently it has two stages only:
1. real name
2. alias

You want:
3. alias of alias

Or, did I get it wrong?


beny.rfg

#10
Hi Diri,

no, i just want to remove commas from the URLs.

Instead this: /bio-kapsicka-jablko,-karotka,-banan-ovko-90-g-detail I need this: /bio-kapsicka-jablko-karotka-banan-ovko-90-g-detail

Thanks, Petr

diri

One can edit alias.

What about deleting comma there?

Jenny2025

#12
Confirm. I have the same problem with my sites.
Every time I edit in the Virtuemart code to fix it.

Apparently this happened after virtuemart switched to its transliteration, abandoning the standard Joomla transliteration.
Transliteration Joomla works perfectly, such problems with the categories/content of Joomla is not observed.

This problem is not new. Here is a link to the 2014 article on the solution we have to use when creating a new Virtuemart store https://jdevelop.info/articles/joomla-extensions/420-net-transliteratsii-v-virtuemart-2-6-6
My sites use russian language (ru-RU).
The problem occurs when you enable transliteration in Virtuemart settings (thank you for taking this option to settings).

Problem with symbols:

, - replaced by %2C. Comma can be removed when forming an alias;

ъ - when creating a category/product with this letter, it is replaced by the characters %D1%8A. The letter ъ can be removed when forming an alias;

Category/product on the site does not open because of the % symbol. % breaks the link.
When you re-save the category/product % is deleted, the letters are converted to lowercase. It turns out like this d1-8a.

" - commas. This problem is not of transleithania, and the field category name/product. When you create a category/product with quotes, for example, Набор кастрюль "Ромашки", the alias is generated correct nabor-kastryul-romashki, but in the category/product name field only Набор кастрюль is displayed, and if you save, then this name will be saved and the site will be displayed as Набор кастрюль, and Ромашки is already hopelessly lost.

Link to the decision http://virtuemart.su/forums/topic/obrezaet-nazvanie-kategorii-posle/

/administrator/components/com_virtuemart/views/product/tmpl/product_edit_information.php
<input class="required inputbox" type="text" name="product_name" id="product_name" value="<?php echo htmlspecialchars($this->product->product_name); ?>" size="32" maxlength="255" />

/administrator/components/com_virtuemart/views/category/tmpl/edit_categoryform.php
<?php echo VmHTML::row('raw','COM_VIRTUEMART_CATEGORY_NAME',VmHtml::input('category_name',htmlspecialchars($this->category->category_name),'class="required inputbox"').$this->origLang); ?>

Please tell me how we can solve this problem once and for all?
Excuse me for my English.

Milbo

Quote from: Jenny2025 on April 01, 2019, 12:04:09 PM
Apparently this happened after virtuemart switched to its transliteration, abandoning the standard Joomla transliteration.
Transliteration Joomla works perfectly, such problems with the categories/content of Joomla is not observed.

Transliterate slugs just enables the joomla standard transliteration!

$unicodeslugs = VmConfig::get('transliterateSlugs',false);
if($unicodeslugs){
$lang = vmLanguage::getLanguage();
$this->$slugName = $lang->transliterate($this->$slugName);
}


$lang is just the normal joomla language.

What you do is using two settings which do not work together. In joomla you have a configuration setting for the URLS, check your SEO settings and there is a setting called "Unicode Aliases" and these setting creates your % and then you have transliterateSlugs enabled, that does not work as you explained yourself perfectly
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Jenny2025

Quote from: Milbo on April 10, 2019, 09:20:40 AM
Quote from: Jenny2025 on April 01, 2019, 12:04:09 PM
Apparently this happened after virtuemart switched to its transliteration, abandoning the standard Joomla transliteration.
Transliteration Joomla works perfectly, such problems with the categories/content of Joomla is not observed.

Transliterate slugs just enables the joomla standard transliteration!

$unicodeslugs = VmConfig::get('transliterateSlugs',false);
if($unicodeslugs){
$lang = vmLanguage::getLanguage();
$this->$slugName = $lang->transliterate($this->$slugName);
}


$lang is just the normal joomla language.

What you do is using two settings which do not work together. In joomla you have a configuration setting for the URLS, check your SEO settings and there is a setting called "Unicode Aliases" and these setting creates your % and then you have transliterateSlugs enabled, that does not work as you explained yourself perfectly


We do not use Unicode in url. This is bad for SEO and links look ugly when you share a link.
We use url with Latin letters.
An example of a category http://krai.user2065992.atservers.net/katalog/obogrevateli-na-solyarke-i-kerosine


1. I installed the latest version of Joomla
I do nothing, just create article in the "Content - Articles".
The subject article of this set: Запятая , ТверSPAMый знак ъ и кавычки " - наши лучшие SPAMрузья
Save article.
Joomla forms an alias: zapyataya-tverdyj-znak-i-kavychki-nashi-luchshie-druzya

Perfect! Clean and no extra characters. The comma and the letter "ъ" have been deleted.


2. I am installing the latest version of Virtuemart.
Do not do anything, just create a product in Virtuemart.
Name of product ask such same: Запятая , ТверSPAMый знак ъ и кавычки " - наши лучшие SPAMрузья
Save product.
Virtuemart forms an alias: запятая-,-тверSPAMый-знак-ъ-и-кавычки-наши-лучшие-SPAMрузья
https://yadi.sk/i/KBR0FMgmJEV9TA

Cyrillic... It seems that everything looks not bad, but it needs to be like this: "zapyataya-tverdyj-znak-i-kavychki-nashi-luchshie-druzya".

Output to the main Virtuemart, check how the product opens.
http://slugs/index.php/%D0%B7%D0%B0%D0%BF%D1%8F%D1%82%D0%B0%D1%8F-,-%D1%82%D0%B2%D0%B5%D1%80%D0%B4%D1%8B%D0%B9-%D0%B7%D0%BD%D0%B0%D0%BA-%D1%8A-%D0%B8-%D0%BA%D0%B0%D0%B2%D1%8B%D1%87%D0%BA%D0%B8-%D0%BD%D0%B0%D1%88%D0%B8-%D0%BB%D1%83%D1%87%D1%88%D0%B8%D0%B5-%D0%B4%D1%80%D1%83%D0%B7%D1%8C%D1%8F-detail
Comma really does not break the link and the product successfully breaks away. But just look at this link! It's awful! That's why we do not use Cyrillic in the url.

3. Go to Virtuemart settings and in the tab SEO enable "Transliterate slugs".
Save the settings, and create a product with the same name: Запятая , ТверSPAMый знак ъ и кавычки " - наши лучшие SPAMрузья
Virtuemart enabled setting "Transliterate slugs" forms an alias: zapyataya-%2C-tverdyj-znak-%D1%8A-i-kavychki-nashi-luchshie-druzya
https://yadi.sk/i/qwbUsdQiXzEpnA

Go to the site, trying to go to the product page, the link he has this:
http://slugs/index.php/zapyataya-%2C-tverdyj-znak-%D1%8A-i-kavychki-nashi-luchshie-druzya-1-detail
But we stay on the category page and the message is displayed "404 The requested product does not exist."
https://yadi.sk/i/v9x1I4aA-MOoFQ

You see this? %2C %D1%8A - they break the link!
Settings Joomla and Virtuemart
https://yadi.sk/i/1vOLoXOgDdE6tg
https://yadi.sk/i/9ghYy4GvksD9BQ

_____________________________________

Result:
Quotes in the product name are no longer a problem. Thank you!  :)
The problem will remain in the category name https://yadi.sk/i/xeYmWKKNiPlfnQ. Here is an example where quotes are used in the category name http://krai.user2065992.atservers.net/katalog/zapchasti

Cyrillic in the url most do not use, because it is not beautiful.
In Joomla articles default transliteration to the Latin alphabet, comma and "ъ" are cut from the alias.

Example of search results in Google on request "купить SPAMрель" ("buy a drill")
https://www.google.by/search?q=%D0%BA%D1%83%D0%BF%D0%B8%D1%82%D1%8C+%D0%B4%D1%80%D0%B5%D0%BB%D1%8C&hl=ru&ei=BRvIXKrsMOjCrgSn8YPgDQ&start=0&sa=N&ved=0ahUKEwjqgtXyxffhAhVooYsKHaf4ANw4ChDy0wMIhQE&biw=1920&bih=937
On the first two pages of any website who would use Cyrillic in the url, only Latin.

Sincerely, Jenny