Re: Mercury template and language switcher
Andreas Zahner via opencms-dev <[email protected]> Tue, 19 Aug 2025 08:13:04 +0200
| Newsgroups | gmane.comp.cms.opencms.devel |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--===============3624968114176234513==
Content-Type: multipart/alternative;
boundary="------------eJm7m1aIcdA1HFNcp09z9RW5"
This is a multi-part message in MIME format.
--------------eJm7m1aIcdA1HFNcp09z9RW5
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
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
>
>
>
--------------eJm7m1aIcdA1HFNcp09z9RW5
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Laurent,</p>
<p>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.</p>
<p>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.</p>
<p>To enable the language switcher, you have to follow these steps:</p>
<ul>
<li>Go to the "Websites" app and edit the website where you want
to use the language switcher.</li>
<li>Add the following module parameters to the website
configuration:</li>
<ul>
<li>locale.main=de</li>
<li>locale.secondary=en</li>
</ul>
<li>Please note: the parameter "locale.secondary" can contain
multiple, comma separated locale names.</li>
<li>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).</li>
<li>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.</li>
<li>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:</li>
<ul>
<li>For a link e.g. to the english version of your website,
enter the value "opencms://locale@en" as link target.</li>
</ul>
<li>Place this link sequence e.g. in the header modelgroup for
your pages.</li>
</ul>
<p>If you followed these steps, the link will always point to the
corresponding page in the desired language.</p>
<p>Kind regards,</p>
<p>Andreas</p>
<pre class="moz-signature" cols="72">--
Andreas Zahner
Alkacon Software GmbH & Co. KG - The OpenCms Experts
<a class="moz-txt-link-freetext" href="http://www.alkacon.com">http://www.alkacon.com</a>
<a class="moz-txt-link-freetext" href="http://www.opencms.org">http://www.opencms.org</a></pre>
<div class="moz-cite-prefix">Am 12.08.25 um 16:25 schrieb
laurent.druart via opencms-dev:<br>
</div>
<blockquote type="cite"
cite="mid:[email protected]">
<pre wrap="" class="moz-quote-pre">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
<a class="moz-txt-link-freetext" href="https://lists.opencms.org/mailman/listinfo/opencms-dev">https://lists.opencms.org/mailman/listinfo/opencms-dev</a>
</pre>
</blockquote>
</body>
</html>
--------------eJm7m1aIcdA1HFNcp09z9RW5--
--===============3624968114176234513==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KVGhpcyBtYWls
IGlzIHNlbnQgdG8geW91IGZyb20gdGhlIG9wZW5jbXMtZGV2IG1haWxpbmcgbGlzdApUbyBjaGFu
Z2UgeW91ciBsaXN0IG9wdGlvbnMsIG9yIHRvIHVuc3Vic2NyaWJlIGZyb20gdGhlIGxpc3QsIHBs
ZWFzZSB2aXNpdApodHRwczovL2xpc3RzLm9wZW5jbXMub3JnL21haWxtYW4vbGlzdGluZm8vb3Bl
bmNtcy1kZXYKCgoK
--===============3624968114176234513==--