WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: RonR on April 21, 2017, 12:04:54 PM

Title: Multilanguage and onepage layout
Post by: RonR on April 21, 2017, 12:04:54 PM
Trying to make a onepage layout template multilingual with Mod Multiligual.

Getting all pages in all languages in the menu, so I need to get the $iMultiLang somewhere in the  function show_menu?

OR a  way to make the "function get_onePagerData()" select only the pages in the current language.

I am not much of a coder.
Anyone any ideas?

Ron
Title: Re: Multilanguage and onepage layout
Post by: Ruud on April 21, 2017, 12:27:22 PM
The get_onePagerData() is starting with this query:
Code: (original) [Select]
$p = $database->query("SELECT * from ".TABLE_PREFIX."pages where `visibility` = 'public' order by `position`");
Try changing that to:
Code: (untested) [Select]
$p = $database->query("SELECT * from ".TABLE_PREFIX."pages where `visibility` = 'public' AND `language`='".LANGUAGE."' order by `position`");
It should get only pages in the current language.
Title: Re: Multilanguage and onepage layout
Post by: RonR on April 21, 2017, 12:33:51 PM
Works like a charm!
Thanks for your help, Ruud!

Ron