To enter in different languages?

hello community,
i have a website and i can switch it to english and german, but i dont know how to switch the menu to english and german.
hoping for lots of help!

bobbi

The menu is usually generated automatically from the title of the visible pages (if you use the Langkit as a starting point), so you should always get the menu in the target language, provided that you have translated your content.

For reference, have a look at the Kirby Langkit.

there is no german guide right? my menu is in the header (i have a snippet header).
i dont know how to do ths

Could you pls. post your header snippet code? And what is the result you get vs. the result you expect to get?

And no, there is no German documentation.

Edit: You have set up your site as a multi-language site, haven’t you?

everything else on my homepage i can switch to english or german. but the menu is different from the others. because its in the header. i had a suggestion to change this in the blueprint??

like this (next post)

Could you pls. always post code as text (code blocks enclosed in three backticks), so that we can adapt your code.

The problem has nothing to do with your menu being in the header. The problem is that you hard code the menu entries in German. When using a Content Management System, you don’t do that but fetch the content from the content files. See the docs, i.e. something like this:

<?php

// main menu items
$items = $pages->visible();

// only show the menu if items are available
if($items->count()):

?>
<nav>
  <ul>
    <?php foreach($items as $item): ?>
    <li><a<?php e($item->isOpen(), ' class="active"') ?> href="<?php echo $item->url() ?>"><?php echo $item->title()->html() ?></a></li>
    <?php endforeach ?>
  </ul>
</nav>
<?php endif ?>

ok… hard to understand :D. so i use this in my header? and do i need a menu template? (blueprint and template)

You don’t need a template or blueprint for the menu, as I said, the menu snippet (no matter if it is a separate snippet or in the header) pull the titles from the content files of the pages. You only need blueprints for pages.

ok i try it later, because right now my laptop doesnt have energy anymore. i write later, if its works! thank you for your help!

My advice is to study the Kirby Langkit to get a feeling about how this works and read the documentation.

thank you! i tried almost 3hours yesterday and now it works! so the pagename is also the menuname, right? the english switching to german.
but every page my menu works, except one page does not work. the menu isnt shown

Well, starting with something new takes time in the beginning. If you have never developed dynamic websites before, there’s certainly a learning curve to pick up enough PHP knowledge to get along. But the time is well invested, and with Kirby anyway :wink:

In the code snippet above, the title of the page is used as the menu entry, that’s right. If you want the menu items to have a different name, you could introduce a new field into your pages, e.g. something like “menu_title” and then use that in your menu.

If the menu is not shown on a particular page, you maybe forgot to include the menu snippet? If nothing is shown on the page, there’s probably an error in your code somewhere.