menu in multi language

Menu in multi language, a forum discussion on Jojo CMS. Join us for more discussions on Menu in multi language on our General Discussion forum.

Back to Forum Index : Back to General Discussion   RSS
Jaijaz Jaijaz

10 Oct 2009
Posts: 215

So I am getting my first "complicated" multi language site going. We don't currently have content for the other languages but I am setting everything up. Everything is working fairly well except for the main menu in the other languages. The pages are coming up in the subnav smarty variable and not the mainnav like I thought it should.

I am using 1.0rc2. The one thing I may have shortcuted is the english pages are under a main language header page like the other two, would that effect it?
If you not living on the edge you taking up too much space.
tom

Developer

tom

11 Oct 2009
Posts: 379

for multilanguage sites you need to establish the root pages for the language first, before using getNav, so it knows where to start the tree from.

Each language should be under its own 'holding' page, which is set as the root for that language in the language table. The stuff that Michael added recently complicates it a bit further, in that you need to also set the root/home pages for each language in the countries/languages table too.

eg, in global:

/* Create navigation array */
$root = 0;
if (_MULTILANGUAGE && isset($page)) {
/* If on a multilanuage site, get the root for the current language */
$mldata = JOJO::getMultiLanguageData();
$root = $mldata['roots'][$page->getValue('pg_language')];
$smarty->assign('home', $mldata['homes'][$page->getValue('pg_language')]);
$smarty->assign('root', $root);
}
/* assign navigation: _getNav() = ("home page", "# Levels of sub nav") */
$smarty->assign('nav', _getNav($root, 3));
$smarty->assign('footernav', _getNav($root, 0, 'footernav'));
Jaijaz Jaijaz

11 Oct 2009
Posts: 215

Yeah that makes sense. I had sort of suspected as much.

Thanks Tom, I'll give it a go.
If you not living on the edge you taking up too much space.
Back to Forum Index : Back to General Discussion   RSS
You must be logged in to post a reply



You need to Register or Log In before posting on these forums.