WebsiteBaker Modules, Snippets, Admin-Tools

WBLingual_v1_0_8

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)

Very Hot SnippetWB approved Snippet

WBLingual_v1_0_8

This snippet switches between different languages

Version 1.0.8
License GPL
Latest add-ons update 2018-10-25 17:22 UTC
Download Counter 852
Developer Luisehahne
Addon type Snippet
Category System Tools
WebsiteBaker Version 2.12
PHP Version 5.6
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 2018-10-25 18:13 UTC by WebsiteBaker Addons Project