Page 1 of 1

Multilingual site and news article custom url

Posted: Mon Sep 18, 2017 1:09 pm
by Mich-adg
Hi,

i need for a project to have 3 languages, with in each language the same products but of course with a specific url.
So the url must look like :
www.root.com/mypage (must be translated)/mycategory (can be the same in 3 langs)/product-name (can be the same in 3 langs)
So i want 1 article for 1 product (and within 3 langs translations fields), but how to manage a perfect url? Is it possible with news module to modify for example http://www.root.com/news/16/17/product-name.html to http://www.root.com/mypage/mycategory/product-name.html.
Must i use htaccess to modifiy the urls ? Does anybody have one sample that work?

Thanks for any help!

Re: Multilingual site and news article custom url

Posted: Fri Sep 22, 2017 6:52 am
by velden
I *think* it can be done but it will always involve two steps:

Inside the template displaying the urls you need to change the url according to the language. Perhaps by a (regex) replace using Smarty.

Then, in the .htaccess you need to rewrite those urls back to the original ones which are the only ones recognized by News module (note that you could add query strings to this rewritten urls during this process, so inside the module template you can determine the original language of the url clicked).

I'm not sure if other modules have better multi-language support regarding custom urls.

Re: Multilingual site and news article custom url

Posted: Fri Sep 22, 2017 1:51 pm
by calguy1000
This is not easily possible with the News module.

As @Velden said, you may be able to trick the system by
a: adjusting the URL's in the summary and detail templates to have the appearance of what you want
b: adjusting your .htaccess file to translate the URL back to something that the News module understands and can route to.
but it will always be problematic.

There is certainly nothing built in to CMSMS or the News module to allow you to specify a pattern for the URL like that.

Re: Multilingual site and news article custom url

Posted: Fri Sep 22, 2017 8:23 pm
by Rolf
You can use the pretty url template of the CGBlog module for this.
Each language needs its own category.

So root-url/category/blog-title

Re: Multilingual site and news article custom url

Posted: Tue Sep 26, 2017 7:27 am
by Mich-adg
Thanks for your help, i'll test CGBlog ;)

Re: Multilingual site and news article custom url

Posted: Mon Oct 16, 2017 4:42 pm
by HarmO
you could check how i solved the same problem viewtopic.php?f=28&t=71898&p=318079#p318079

the only difference is that i used 2 separate Listit2 modules in this example.

You could go 1 step further and use 1 LISE module.
I did this on http://viaviastellenbosch.travel
The disadvantage in this solution is that you only have 1 "alias" per item so your url will be almost the same for every language.

Re: Multilingual site and news article custom url

Posted: Tue Oct 17, 2017 12:01 pm
by Mich-adg
Thanks for the help.
It would be very nice to be able to create custom text filed for each url lang (for Lise and other mods), perhaps someone has achieve this !?