Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Can't view the menu in 2 languages

edited January 2014 in I18n

Hi!

I've installed the CMS Elephant (v1.3.6). It works great but there's a problem. I've tried to create a bilingual site but I can't view for each language an specific menu in their language.

  1. I've created 2 languages (english and catalan)
  2. I've written for every main index the Page ID: en and ct
  3. Then I've created additional pages for each language and created a site tree like this: en en2 en3 ct ct2 ct3
  4. I've changed in conf/config.php the multilingual to On

And the navigation menú appears only in english in the 2 different languages. Why?

I don't know what to do... I've tried to change also in the default.php the {! navigation/top !} for {! navigation/index?id=[i18n.language] !} but it obviously doesn't works...

What I'm doing wrong?

Thanks in advance.

Comments

  • The navigation/top tag should work without change, hmm... Does your menu look like this under Tools > Navigation?

    http://imgur.com/Pvwf0Qh

    As long as the top-level pages have IDs that match the language codes ('en', 'ct', etc), the navigation should show the correct sub-tree based on the language of the user.

  • Yes, my menu appears like the image... What can I do?

  • If I put {! navigation/top !} in the layout.php page the menu appears only in english in the 2 diferent languages (mysite.com/en and mysite.com/ct).

    There's any code to change the menu like these: {! navigation/top-[id] !}, {! navigation/[id] !}, {! navigation/index-[id] !}...?

    Thanks in advance.

  • What is your negotiation_method setting set to in conf/config.php? If it's the default (http), then the language choice is made based on the visitor's browser or system settings automatically. That way you don't actually need to provide a language choice on the site.

    If you set it to url then the right menu should come up when you visit /en or /ct, because it will look in the URL. The limitation of the url approach is the built-in apps don't automatically add /ct/ to links like /user/signup so you have to do a bit more custom work to make sure the links keep the user in the language they want.

    It can also use a cookie or subdomain to set the language, e.g., ct.example.com.

    If you choose a method other than http, I recommend using the {! navigation/languages !} handler somewhere to create links to choose the language, and then use CSS to style them how you want.

    Hope that helps!

Sign In or Register to comment.