WebsiteBaker Modules, Snippets, Admin-Tools

WebsiteBaker_Lingual_v2_0_7

user rating: average score 5.0, by 3 votesaverage score 5.0, by 3 votesaverage score 5.0, by 3 votesaverage score 5.0, by 3 votesaverage score 5.0, by 3 votes (click to vote)

Hot SnippetWB approved Snippet

WebsiteBaker_Lingual_v2_0_7

This snippet switches between different languages

Version 2.0.6
License GPL
Latest add-ons update 2023-02-16 13:43 UTC
Download Counter 1910
Developer Luisehahne
Addon type Snippet
Category System Tools
WebsiteBaker Version 2.13.0 (minimum)
PHP Version 7.4
Forum Discussion (EN) Click here to visit
 

This snippet switches between different languages

To execute Multilingual you have to
1) Enable Page Languages
2) Page Level Limit higher 1 (folder level)
3) Required template modifications
see readme.txt
4) Setting up the page structure
Help designerguide
Language selection via the intro page no longer needed
5) After installing the Multilingual modul
In Modify Page Settings you find an extra field Pagecode with a directory listing with pages from default languages.
The folder level is limited by the value from Page Level Limit

a) Create your pages for the default language
b) Create your pages for the 2nd language
c) select a page in the 2nd language area and call Modify Page Settings
d) in field Pagecode select the default language page and save

6) Call procedure in Frontendtemplate

if (!function_exists('LangPadeId')) {function LangPadeId(){return $iPageId;}}
// 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) {
?>
<!-- comment out if you want the hreflang attribute
    <link rel="alternate" hreflang="x-default" href="[wblink<?php echo LangPageId($sPageLang);?>]" />
    <link rel="alternate" hreflang="de" href="[wblink<?php echo LangPageId('DE');?>]" />
    <link rel="alternate" hreflang="en" href="[wblink<?php echo LangPageId('EN');?>]" />
-->
<?php } ?>


 




Last change 2023-02-16 13:43 UTC by WebsiteBaker Addons Project