The Website Baker Code snippet Easy Multilanguage Link is useful on multilanguage sites only. It provides links to pages in other languages with the same content as the current page. I use the snippet on the site you are visiting now.
It is not necessary that all pages exist in all languages or that the page trees of different languages have the same structure.
How it works:
It is necessary to replace some kernel files, because we need a new field (I called it Page Code) in the page settings. For all pages with the same content you enter the same Page Code (you can also call it keyword).
The snippet will show the languages of all pages with the same Page Code as link menue.
There are two special Page Codes:
- home is the home page of a language. It is used when no page with the current page code is available for a language.
- none does switch off the language menu for the current page. This might be useful within a multipage form, for instance.
Add the following line to your template:
<?php easymultilang_menu(); ?>
The file HowTo explains the necessary steps.
Home page of the snippet on AMASP: http://www.websitebakers.com/pages/code-snippets/various/easy-multilanguage-link.php
The snippet now comes with patches for WB 2.7 and WB 2.8.0
Important hint for users of WB 2.8.1
Easy Multilanguage Link v. 0.4.2 is not compatible with Website Baker v. 2.8.1.
Even under older versions of Website Baker the module did need to patch some Kernel files.
The developer responsible for those Kernel files decided to release his own Multilanguage module. He did hard code links to his module into the Kernel, and let it use the same variable name as Easy Multilanguage Link does. This way he cut off the possibility to use Easy Multilanguage Link in WB 2.8.1 and later.
Sure it would be possible to change the Kernel files back for compatibility with Easy Multilanguage Link. Whilest earlier patches did enhance the features of the Kernel, such a new patch would change some of the new functionality. I do decline to make such patches. I am quite sure at some point in the future the new module will be part of the WB kernel.
My suggestion for Website Baker 2.8.1 and above is:
Instead of Easy Multilanguage Link use the new module Multilingual from http://www.websitebaker-next.de/wb/pages/de/startseite/websitebaker-2.8.x.php.
Deutsch
English