Multilingual site and news article custom url

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
Mich-adg
Forum Members
Forum Members
Posts: 199
Joined: Sat Aug 02, 2008 9:08 pm

Multilingual site and news article custom url

Post 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!
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3484
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Multilingual site and news article custom url

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Multilingual site and news article custom url

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: Multilingual site and news article custom url

Post 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
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Mich-adg
Forum Members
Forum Members
Posts: 199
Joined: Sat Aug 02, 2008 9:08 pm

Re: Multilingual site and news article custom url

Post by Mich-adg »

Thanks for your help, i'll test CGBlog ;)
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm
Location: Belgium

Re: Multilingual site and news article custom url

Post 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.
Kind regards,
HarmO
Mich-adg
Forum Members
Forum Members
Posts: 199
Joined: Sat Aug 02, 2008 9:08 pm

Re: Multilingual site and news article custom url

Post 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 !?
Post Reply

Return to “The Lounge”