Guys I really need your help. I’m stuck with a bug I can’t find!
Multilanguages site.
In my header snippet I have a div#languages
with the following code:
<div id="languages">
<?php foreach($kirby->languages() as $language): ?>
<?php if($kirby->language() != $language): ?>
<a href="<?php echo $page->url($language->code()) ?>" hreflang="<?php echo $page->url($language->code()) ?>">
<?php echo html($language->code()) ?>
</a>
<?php endif ?>
<?php endforeach ?>
</div>
My website, though, always switches on the same page, both in Italian and German (not even the homepage) and I don’t understand why.
This is not the first time I use this code and it usually works just fine. That’s why I’m also thinking that maybe the problem is somewhere else.
If I print_r($page->uid())
or whatever in the header snippet always shows the same page, while if I do the same thing on a template the print is correct.
I use Kirby 3.5.3.1 on this project.
Here my website on our dev server:
dev.lucasdesign.ch/VDE
Do you have any idea?
Thank you very much!
Sara