[opencms-dev] Mercury template and language switcher
Andreas Zahner
a.zahner at alkacon.com
Tue Aug 19 08:13:04 CEST 2025
Laurent,
first of all we do not recommend to use the single tree approach for
multi language websites, mainly because of SEO reasons: you cannot
create language specific URLs for your pages.
We developed and tested the language switcher only for websites that are
not using the single tree approach, so I cannot give you a guarantee
that it will work there.
To enable the language switcher, you have to follow these steps:
* Go to the "Websites" app and edit the website where you want to use
the language switcher.
* Add the following module parameters to the website configuration:
o locale.main=de
o locale.secondary=en
* Please note: the parameter "locale.secondary" can contain multiple,
comma separated locale names.
* After that, you can use the "Compare locales" feature in the Sitemap
editor of your website. You can find it as menu entry when clicking
on the "Select view" icon (right icon on the left hand side).
* In this view, you can link pages to their matching localized
versions or copy them to the other locale if no matching page exists
yet.
* After you have done the steps above, you can add links to other
language versions in a link sequence element and add a new link item
in the content:
o For a link e.g. to the english version of your website, enter
the value "opencms://locale@en" as link target.
* Place this link sequence e.g. in the header modelgroup for your pages.
If you followed these steps, the link will always point to the
corresponding page in the desired language.
Kind regards,
Andreas
--
Andreas Zahner
Alkacon Software GmbH & Co. KG - The OpenCms Experts
http://www.alkacon.com
http://www.opencms.org
Am 12.08.25 um 16:25 schrieb laurent.druart via opencms-dev:
> Hello,
>
> Does mercury template contain a language switcher and if yes how to use it?
>
> I already configured my test website with single tree approach following the documentation.
>
> Thank you,
>
> Kind regards,
>
> Laurent
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> https://lists.opencms.org/mailman/listinfo/opencms-dev
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20250819/45cb94ad/attachment.htm>
More information about the opencms-dev
mailing list