Language Kit - Language Select Dropdown Issue

Hey there,

sorry i am new with php.
i used the kirby language kit.
everything works fine. no i want to display the language selection in dropdown.
i tried this. it shows the dropdown, but the navigation between the sites don´t work.

    <nav class="navigation  menu column" role="navigation">
      <ul class="site-nav">
        <?php foreach($pages->visible() as $item): ?>
        <li class="menu-item<?= r($item->isOpen(), ' is-active') ?>">
          <a href="<?= $item->url() ?>"><?= $item->title()->html() ?></a>
        <?php endforeach ?>
    <?php foreach($site->languages() as $language): ?>
    <li class="languages-item<?php e($site->language() == $language, ' is-active') ?>">
          <a href="<?= $page->url($language->code()) ?>"><?= str::upper($language->code()) ?></a>
        <?php endforeach ?>

thank you very much for tipps and helping

Are you on Kirby 2 or 3?



i used this:

There are several problem with your HTML markup that are not at all related to PHP or Kirby.

  1. You can’t have a select element as direct child of an ul element
  2. You can use anker links or li elements inside an option tag, you would need JavaScript to redirect to another page when the user selects something.

The first link I posted above has an example how to set up a language switch. Why don’t you work with a standard link list instead of a select field?