Switch language question:

Due to design reasons, I would like to stick with this line for switching languages, which only shows the other language in short form:

<a class="fancynavbar-addon-item" href=""<span class="text-sans-serif ls font-weight-black fs-0">TR</span></a>

I found some code in the Kirby Guide which shows all available languages:

 <nav class="languages">

Is it possible to „show“ only the other language?



Only TR or only DE, however not the current language but the other one.

Thanks a lot in advance for any help.

Best regards,


$languages = $kirby->languages()->not($kirby->language());

Should give you all languages but the current language.

I found another way. Thank you anyway for your help.

Would you mind to share your approach?

There were too many options to put in the php code, options which I simply cannot code with my present knowledge:

  1. If the page is in Turkish then I want to see DE or the other way around (not a selection area)
  2. The url of the page in the other language
  3. Put inline css style “display:none” if the page is not (or will not) be translated into the other language.

I created a field in the panel to put the variables manually:

<a class="fancynavbar-addon-item" href="<?= url('/ok') ?>"><span class="text-sans-serif ls font-weight-black fs-0">TR</span></a>

<a class="fancynavbar-addon-item" href="<?= url('/tr/ok') ?>"><span class="text-sans-serif ls font-weight-black fs-0">DE</span></a>

<a class="fancynavbar-addon-item" href="#"><span class="text-sans-serif ls font-weight-black fs-0" style="display:none">TR</span></a>

I know it is not a good solution. But what can I do? :slight_smile:



This is certainly not a good solution and will get messy very soon if you have more than one page.