WebsiteBaker Support (2.11.x) > General Help & Support

Multilanguage

(1/8) > >>

rumen:
I saw there is no need to install multilingual module in 2.11. But - how it works? Any docs? Idea? Hint?

dbs:
Take a look into the defaultTemplate.
The menue structure for multilingual is the same like before.
EN,DE,NL... now can also be normal pages (not only menue_link).

rumen:
Maybe I do something wrong, but when I put this code the page crashes.


--- Code: ---<?php
// if function LangPadeId doesn't exists, you have to upgrade WBLingual Switcher Add-on to latest version'
if (!function_exists('LangPadeId')) {function LangPadeId(){return PAGE_ID;}}
// to show flags in frontend
    $iMultiLang = 0;$sMultiLang = ''; if (function_exists('language_menu')){$sMultiLang = language_menu('png',false); $iMultiLang = intval(!empty($sMultiLang) ? 1 : 0);}
    if (function_exists('LangPadeId')&&$iMultiLang) {
?>

    <link rel="alternate" hreflang="x-default" href="[wblink<?php echo LangPadeId($sPageLang);?>]" />
    <link rel="alternate" hreflang="de" href="[wblink<?php echo LangPadeId('DE');?>]" />
    <link rel="alternate" hreflang="en" href="[wblink<?php echo LangPadeId('EN');?>]" />
--- End code ---

rumen:
When I call the EN page from back end I get error:


--- Code: ---The page isn’t redirecting properly

Cliqz has detected that the server is redirecting the request for this address in a way that will never complete.

    This problem can sometimes be caused by disabling or refusing to accept cookies.

--- End code ---

And in the address of the browser I see


--- Code: ---http://zapryanov.faith/pages/home.php?lang=EN&lang=EN&lang=EN&lang=EN&lang=EN&lang=EN&lang=EN&lang=EN&lang=EN&lang=EN&lang=EN&lang=EN&lang=EN&lang=EN&lang=EN&lang=EN&lang=EN&lang=EN&lang=EN&lang=EN


--- End code ---

And it should be only:


--- Code: ---http://zapryanov.faith/pages/home.php?lang=EN
--- End code ---

dbs:
Is this the right DefaultTemplate?
In my 2.11 i see in line 42,43

--- Code: ---$sPageLang    = strtolower(isset($wb->page) || ($wb instanceof frontend) ? $wb->page['language'] : 'EN');
$iPageId = (defined('PAGE_ID') ? PAGE_ID : 0);
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version