|
Cookbook /
MultiLanguagePagesSummary: Show language specific pages according to user choice
Version: 1.0
Prerequisites: PMWiki 2.x
Status: new
Questions answered by this recipeHow can I show language specific pages according to user choice when I would prefer to have one page per language? DescriptionThis recipe has a different approach compared to the recipes MultiLanguage and MultiLanguageViews to show language-specific content as it is based on a one-page-per-language principle. Setup
Site|Group/PageHeaderThis file should contain the language switching. Here is an example for the contents of that file:
%lfloat% [[{*$Group}/ | Path:path-to-your/logo.jpg"your-title"]]
! your site title
%right%
(:if ! equal {*$Group} En :)(:if2 exists En.{*$Name}:)
[[En.{*$Name}|Path:path-to-flags/en.png"English"]]
(:if2end:)(:ifend:)
(:if ! equal {*$Group} De :)(:if2 exists De.{*$Name}:)
[[De.{*$Name}|Path:path-to-flags/de.png"Deutsch"]]
(:if2end:)(:ifend:)
...
This will show the flags for the existing pages in all other languages only. Group/NavBarFor the navigation menu one needs one file per language. This file could look like this (example for the English menu as an unordered list): (:if exists en.HomePage:) * [[en.HomePage | Home()]] (:if:) (:if exists en.Service:) * [[en.Service | Services (Services offered)]] (:if:) (:if exists en.About:) * [[en.About | About us (Our Story)]] (:if:) ... Site|Group/PageFooterAs this file normally contains language-specific copyright notices etc. one file per language will be necessary in most cases. NotesToDo
Release notes
See alsoMultiLanguage and MultiLanguageViews ContributorsCommentsUser notes +1: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |