One more approach to build a multilingual site with the regular CMSMS

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
User avatar
alinome.net
Forum Members
Forum Members
Posts: 124
Joined: Thu Jan 25, 2007 2:54 pm
Location: España / Hispanujo / Spain

Re: One more approach to build a multilingual site with the regular CMSMS

Post by alinome.net »

dung wrote: It must working, but I have a problem to display the menu (a hroizontal one).

When I did this step :

Step 4: Create the content menu
How do you show in your navigation menu only the pages in the current language?
You can use the {menu} tag with the parameter start_element, to select the root section header of the language
.

You wrote : select the root section header, but this root section is hidden (not displayed in the menu in the step 1) !

So how can I see all the sections under this language ?
Hi dung, I'm glad this program is useful to you.

Yes, the root section is hidden because it's used only to organize the pages. But if you select it with start_element you will get all pages under it. I don't remember all the parameters of the {menu} tag. In step 4 I mentioned start_element and start_level, but in my site I used start_page. It depends on what you need. Read the help of the menu module to learn how to use all its parameters and try them.

Hope this helps.

Cheers,

Marcos
Marcos Cruz
dung
New Member
New Member
Posts: 8
Joined: Wed Dec 31, 2008 2:47 pm

Re: One more approach to build a multilingual site with the regular CMSMS

Post by dung »

Dear Marcos,

Thank you for your quick reply.
I tried with start_page as in the following code :


{if $page_lang == "fr"}{menu template='cssmenu.tpl' start_page='fr'}
   {else}{menu template='cssmenu.tpl' start_page='en'}
{/if}


OR with start_element as in the following code :


{if $page_lang == "fr"}{menu template='cssmenu.tpl' start_element='5'}
   {else}{menu template='cssmenu.tpl' start_element='6'}
{/if}


but I don't see the menus and submenus.

My pages hierarchy is :

5 Menu FR (alias 'fr' / Not to be shown in the menu)
5.1 -   Home FR (alias home-fr)
5.2 -   How CMSMS Works FR
5.2.1 -   -   Templates and stylesheets FR
5.2.2 -   -   Pages and navigation FR

6 Menu EN (alias 'en' / Not to be shown in the menu)
6.1 -   Home EN (alias home-en)
6.2 -   How CMSMS Works
6.2.1 -   -   Templates and stylesheets
6.2.2 -   -   Pages and navigation
6.3 -   Default Templates Explained
6.3.1 -   -   CMSMS tags in the templates

Thanks again in advance for your support.
Best regards,

dung
User avatar
alinome.net
Forum Members
Forum Members
Posts: 124
Joined: Thu Jan 25, 2007 2:54 pm
Location: España / Hispanujo / Spain

Re: One more approach to build a multilingual site with the regular CMSMS

Post by alinome.net »

dung wrote: I tried with start_page as in the following code :

Code: Select all

{menu template='cssmenu.tpl' start_page='fr'}
OR with start_element as in the following code :

Code: Select all

{menu template='cssmenu.tpl' start_page='5'}
but I don't see the menus and submenus.
My pages hierarchy is :
5 Menu FR (alias 'fr' / Not to be shown in the menu)
6 Menu EN (alias 'en' / Not to be shown in the menu)
I have consulted what I did in my site (I didn't looked into the template for a long time):

Code: Select all

<div id='menu'>
<ul>
{if $page_lang == "es"}
{menu template='alien_1' start_page='asuntos'}
{menu template='alien_1' start_page='mas'}
{else}
{menu template='alien_1' start_page='aferoj'}
{menu template='alien_1' start_page='pli'}
{/if}
</ul>
</div> <!-- menu -->
As you see, the start_page value, in my case, is not the hidden language section but the first menu option I want to list. I didn't remember this, sorry. Somehow I remember the language menu header could be used too. Try with your menu options 5.1 and 6.1, and let's see...
Marcos Cruz
dung
New Member
New Member
Posts: 8
Joined: Wed Dec 31, 2008 2:47 pm

Re: One more approach to build a multilingual site with the regular CMSMS

Post by dung »

Dear Marcos,

Thanks for your support.

I already tried your solution too by adding several menus :

{menu template='alien_1' start_page='asuntos'}
{menu template='alien_1' start_page='mas'}
{menu ...}
...


but the menus are displayed vertically, not horizontally as I should want.
But perhaps it's a CSS problem.

Moreover, if you add or delete a menu, you have to modify manually the code again ...
It doesn't manage automatically the list of menus !

Thanks again and best regards,

dung
User avatar
alinome.net
Forum Members
Forum Members
Posts: 124
Joined: Thu Jan 25, 2007 2:54 pm
Location: España / Hispanujo / Spain

Re: One more approach to build a multilingual site with the regular CMSMS

Post by alinome.net »

dung wrote: I already tried your solution too by adding several menus :

{menu template='alien_1' start_page='asuntos'}
{menu template='alien_1' start_page='mas'}
{menu ...}
...
It was only an example. I needed the menu in two pieces in my site. I didn't mean it's the solution for you.
dung wrote: but the menus are displayed vertically, not horizontally as I should want.
But perhaps it's a CSS problem.
Yes, it's a CSS and/or menu template problem.
dung wrote: Moreover, if you add or delete a menu, you have to modify manually the code again ...
It doesn't manage automatically the list of menus !
When you use {menu}  you get a whole menu, depending on the parameters. I say again: I pasted my menus only as an example. In my site I see, for every {menu}, all menu options from start_page to the last page of its level (you can see the result: cartasaalien.eu). You need only one {menu}, with your own menu template (or a default one) and your own start_page (and/or other parameters; read the menu manager documentation).

I think your problem is more related to the parameters of {menu} than to the multilingual issue. First forget about the aspect of the menu (that can be solved later) and find out the right {menu} parameters for you. Let me know your results and paste your code (better use the "code" button to markup the code pieces, instead of changing the text color; it's clear).
Marcos Cruz
dung
New Member
New Member
Posts: 8
Joined: Wed Dec 31, 2008 2:47 pm

Re: One more approach to build a multilingual site with the regular CMSMS

Post by dung »

Dear Marcos,

I read a lot and tested again and again, and finally I found the SOLUTION !
You were all right when you said to read the menu manager documentation.
I have to take the parameter
show_root_siblings="1" :

as in {menu template='cssmenu.tpl' start_element="6.1" show_root_siblings="1"}

Thanks again for your excellent formulas and your kind support.

dung
User avatar
alinome.net
Forum Members
Forum Members
Posts: 124
Joined: Thu Jan 25, 2007 2:54 pm
Location: España / Hispanujo / Spain

Re: One more approach to build a multilingual site with the regular CMSMS

Post by alinome.net »

dung wrote: I have to take the parameter
show_root_siblings="1" :
Glad you solved, Dung. The parameters of {menu} are a bit tricky...  :)
Marcos Cruz
Radice
Forum Members
Forum Members
Posts: 10
Joined: Fri Mar 13, 2009 9:06 am

Re: One more approach to build a multilingual site with the regular CMSMS

Post by Radice »

Have I to set only "en" in others languages or "en1" for each pages?

Another question: the link to the other languages (i'm using 3 languages) are not correct.
Take a look:


            EnglishItaliano
         

href to english and italian homepage miss.
Can you help me? thanks
User avatar
alinome.net
Forum Members
Forum Members
Posts: 124
Joined: Thu Jan 25, 2007 2:54 pm
Location: España / Hispanujo / Spain

Re: One more approach to build a multilingual site with the regular CMSMS

Post by alinome.net »

Radice wrote: Have I to set only "en" in others languages or "en1" for each pages?
I don't fully understand what you mean. You have to set "other languages" with the language code and the page alias of every translation avalaible, with the following format:

en=alias-of-the-corresponding-english-page;ru=alias-of-the-corresponding-russian-page

I think this is why you are  having problems. Please confirm if that helps.

Cheers,
Marcos
Marcos Cruz
Radice
Forum Members
Forum Members
Posts: 10
Joined: Fri Mar 13, 2009 9:06 am

Re: One more approach to build a multilingual site with the regular CMSMS

Post by Radice »

Ciao, now i filled "other languages" with es: en=contacts, for the english contents and it=contatti for the italian contents, but href links to english and italian pages still miss.

Thank you
User avatar
alinome.net
Forum Members
Forum Members
Posts: 124
Joined: Thu Jan 25, 2007 2:54 pm
Location: España / Hispanujo / Spain

Re: One more approach to build a multilingual site with the regular CMSMS

Post by alinome.net »

Radice wrote: Ciao, now i filled "other languages" with es: en=contacts, for the english contents and it=contatti for the italian contents, but href links to english and italian pages still miss.
1)

In the "contacts" page you have to fill "other languages" with "it=contatti".
In the "contatti" page you have to fill "other languages" with "en=contacts".

Is that what you are doing?

2)

Have you configured the language array, as described in the instructions, with the languages you are using?

Cheers,
Marcos
Marcos Cruz
Radice
Forum Members
Forum Members
Posts: 10
Joined: Fri Mar 13, 2009 9:06 am

Re: One more approach to build a multilingual site with the regular CMSMS

Post by Radice »

Yes i did:

// Example data
$languages = array(
  'it' => array('italiano', 'Italiano'),
  'en' => array('english', 'English'),
  'sr' => array('serbo', 'Serbo') );
User avatar
alinome.net
Forum Members
Forum Members
Posts: 124
Joined: Thu Jan 25, 2007 2:54 pm
Location: España / Hispanujo / Spain

Re: One more approach to build a multilingual site with the regular CMSMS

Post by alinome.net »

Radice wrote: Yes i did:

// Example data
$languages = array(
  'it' => array('italiano', 'Italiano'),
  'en' => array('english', 'English'),
  'sr' => array('serbo', 'Serbo') );
So I guess "italiano", "english" and "serbo" are the alias of the default pages in every language.

Everything seems OK.

I remember someone in this thread had a problem and the cause was that, in the template, the menu was before the "other_languages" variable, I think, but I updated the implementation guide with that. You can read the thread to look for similar mistakes. The code works, so probably you copied something wrong or misunderstood some instruction. Have you tried to follow again all steps?

Is your site on line? I so, you can send me a temporary account to take a look. If your site is off line, you could send me a copy of all related elements: template and tags.

Sorry for the delay to answer, these days I'm busy off line, but I'll help you to find what's wrong.

Cheers,
Marcos
Marcos Cruz
User avatar
alinome.net
Forum Members
Forum Members
Posts: 124
Joined: Thu Jan 25, 2007 2:54 pm
Location: España / Hispanujo / Spain

Re: One more approach to build a multilingual site with the regular CMSMS

Post by alinome.net »

Radice wrote: Yes i did:
Try this: uncomment all debug lines in the language_menu tag. Then you will be able to follow the program and trace the problem.
Last edited by alinome.net on Thu Mar 26, 2009 2:43 pm, edited 1 time in total.
Marcos Cruz
Radice
Forum Members
Forum Members
Posts: 10
Joined: Fri Mar 13, 2009 9:06 am

Re: One more approach to build a multilingual site with the regular CMSMS

Post by Radice »

Voilà :D

Code: Select all


DEBUG:
language_codes=Array ( [0] => it )
language_pages=Array ( [0] => strumicka-15 )
language_versions=Array ( [it] => strumicka-15 )

DEBUG:
page_lang=it
show_title=1
show_current=
page_title=
language_versions=Array ( [it] => strumicka-15 )
language_buttons=

      menu DEBUG:
      language_code=it
      language=Array ( [0] => italiano [1] => Italiano )

      menu DEBUG:
      language_code=en
      language=Array ( [0] => english [1] => English )
    * alternative_page=DEFAULT CAN NOT BE USED! INACTIVE BUTTON: English

Post Reply

Return to “Tips and Tricks”