215 Posts
iliil
5 years ago
6
Topic

Hi SEBLODers

I have a question regarding the multi-language aliases feature, I never found any guide or tutorial for this (except similar unanswered topics in this forum https://www.seblod.com/community/forums/general-discussions/new-multy-language-aliases )

I understand that multi-language aliases are configured in related Search Type configuration. But how can I create them?

I have a Title and Alias field for each language. I would like to be able to automatically generate other language aliases from other language titles.

Can I achieve that simply with SEBLOD or do I need a custom script in Before Store Plugin. Could you provide a code (or a method that converts a string to an alias format)?

Many Thanks for Help

Michal

Get a Book for SEBLOD
215 Posts
iliil
5 years ago
5
Level 1

If anybody needs to solve this...

I am currently using Before Store plugin and joomla function:

$alias = JFilterOutput::stringURLSafe(trim($your_language_title));

I also manually check if the language alias is unique in the database (I added a index to language aliases db columns), if not I am adding a suffix number.

It works ok, but I don't know if I am not duplicating some existing SEBLOD functionality.

Any comment from Seblod developers is appreciated.

Thanks

Michal

44 Posts
StanislavR
3 years ago
4
Level 2

Hi. iliil

Thanks for the example code for creating aliases in other languages.

Can you tell me how to use these aliases when generating url to materials when switching languages?

thanks

215 Posts
iliil
3 years ago
3
Level 3

Hi Stanislav, I am not sure if I understand your question. SEBLOD takes care of the SEF URLs if you use it's routing. 

Doublecheck if:

-The multilingual aliases are properly stored in #__cck_store_item_content (e.g. alias_en) in the proper format

-Multilanguage Aliases feature is enabled in the parent SEBLOD list 

Best

Michal

44 Posts
StanislavR
3 years ago
2
Level 4

I have a problem. 
If i use english (alias_en) or french (alias_fr), fields that are already created in the system - all OK. 
If I create a new field for another language, for example for Russian (alias_ru), my list is not displayed (error 404).

How to create this field (alias_ru) correctly? Or does this field need additional actions?

215 Posts
iliil
3 years ago
1
Level 5

Can you confirm that the field is stored in the #__cck_store_item_content in the column "alias_ru"?

if you already have some aliases generated, look at the content of Russian aliases, if they are generated from your Russian article titles  in the Russian alphabet, there can be a problem

Look also if the Russian language URL parameter is set as "ru" in your language manager.

Good luck

44 Posts
StanislavR
3 years ago
0
Level 6

Hi, iliil, thank you

Yes, the field "alias_ru" is stored in the #__cck_store_item_content in the column "alias_ru"

No, I have not aliases generator, only manualy.

Yes, for the Russian language URL parameter set as "ru" in my language manager.

If I set NO in  Multilanguage Aliases - all OK. Lists on any languages displayed (RU. EN, LV)

If I set All language/All language except default in Multilanguage Aliases - list on Russian no displayed (404), as well and list on Latvian (alias_lv). Only English.

Only new Joomla (3.9.22) + Seblod (3.19.0), template - protostar.

---

What is it "..in the proper format" for alias_ru ? Columns "alias_ru", "alias_lv" has the same parameters as "alias_en" (varchar 400 and so on) 

Get a Book for SEBLOD