Jump to content

Problem with linking to a page in a different language


julbr
 Share

Recommended Posts

Hello everyone,

I have posted about this issue before and didn't get any answers, i think it's because i didn't explain properly what my problem was. I'll try to explain as detailed as possible, as i think this case might help others with the same situation.

I have setup a site with custom made templates and multi-language support. I'm using a single tree approach with multi language features: Multi-LanguageUrls, Fields and also static translation. So far, everything is good.

In my website i have a Home Page that serves as the welcome page. In it, you have a welcome message and two links, one for the site in Spanish (the default language) and one for the site in English.

As i am using multi language page names, the link for the spanish website points to:

<a href="nosotros-concepto">Sitio en Español</a> 

This is the actual "first page" of the site, after the welcome. The English site link looks like this:

<a href="about-us-concept">Site in English</a>

The problem is this last link still takes me to the Spanish "nosotros-concepto" and the url looks like this:

localhost/mywebsite/es/nosotros-concepto

Both links take me to the same Spanish page. I think i have something conceptually wrong, and i would very much appreciate any comments or help on this issue.

Anyone else encountered something like this?

Thank you all!!

Julian 

Link to comment
Share on other sites

As i am using multi language page names, the link for the spanish website points to:

 

<a href="nosotros-concepto">Sitio en Español</a> 

 

This is the actual "first page" of the site, after the welcome. The English site link looks like this:

 

<a href="about-us-concept">Site in English</a>

 

How are those links created?

The problem is this last link still takes me to the Spanish "nosotros-concepto" and the url looks like this:

 

localhost/mywebsite/es/nosotros-concepto

But then the links should be

/es/nosotros-concepto/

and 

/en/about-us-concept/

no?

I have no idea what you are doing, and why the links are like this. A PW url always looks like this format /pagename/childname/

When LanguageSupportPageNames is installed you can define the /en/ /es/ names on the home page settings.

After that you get correct urls when in one of the languages or you can get a specific alternative language url with $page->localUrl($language). 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...