vanpraetk
I'm new here

Switch language - stay on same page, not redirect to homepage

Hi all,

Currently we have a multilingual firstspirit website. In the top right of every page the visitor can chose between the two language versions (EN / FR)

The site makes use of language ID's as parameters in the url.

The problem is:

When someone is on a page on our website and choses to see the other language version, he gets redirected to the homepage (in the language he has chosen of course) instead of staying on the same page but another language.

Is there a solution for this?

Best regards.

0 Kudos
7 Replies
Peter_Jodeleit
Crownpeak employee

Please post your template fragment here.

Peter
0 Kudos

Hi Peter,

Thanks for the fast response!

What do you mean with the "template fragment"?

The HTML which is pushed to the frontend of the website is just a languagemenu with two links inside, one for English and one for French.

They both link to our homepage, the first link (for the English version) is going to www.ourwebsite.com/?langId=-1

And the second link, (for the French version) is going to www.ourwebsite.com/?langId=-2

As you can see, both links always redirect to our homepage, not to the page where the visitor was.

0 Kudos

Ok, I assumed you already have templates for this.

In FirstSpirit you'll have templates which render your site, and of course you could render a language switch on each page. This is also implemented in our demo project, see http://mithrasenergy.com/ for a rendered version. The language switch is just at the top of each page (but only for pages which are translated).

Peter
0 Kudos

Do you mean the HTML templates?

If I click in the left menu on "Global Settings", I see a tree of templates (not html templates, more "configuration" templates, higher abstraction level). In that tree I go to Global Content Area > Desktop > Navigation > And there I find the "templates" where I can do some configuration of what I want to see in the header of each page. (ex. Login, LanguageMenu, Register now, ... )

When I open the "Language template" I see 3 tabs: "Internal link details", "Time Control" and "Advanced".

In the tab "Internal link details" I can modify the fields like: "Link text", "MouseOver text", "Link type", "View identifier"...

In the tab "Advanced" I can modify the fileds "CSS class", "SEO", ...

Do I have to modify something there?

0 Kudos

Sorry, that that is a completly project related question. As nobody here is familiar with your project and it's templates you should direct your question to a person who has set it up.

Peter
0 Kudos

Hi Peter,

Thanks for the response.

I will try to check with the people who have set up our project.

What exactly did you mean with templates? The html templates?

Can you tell me about best practices to set up a language menu like that?

Best regards

0 Kudos

Templates: FirstSpirit-Templates. Not sure if you call them "html templates".

Best Practice: <a href="$CMS_REF(#global.ref, lang:<your target language here>)$">change language</a>

Peter
0 Kudos