we work on a multi language website.
i have written a little plugin that can swap the content of a page and it does this through an examination on ‘routes’. If the content has to be swapped, i return a different page via
which works well. If nothing has to be swapped, i return the orignal page via
where $slug was handed over by ‘action’. This also works well except for the starting pages.
Let’s say our URL is ‘/de/contact/’, Kirby will handover ‘contact’ as $slug. Returning page($slug); is no problem.
But if the URL is just ‘/de/’, Kirby will handover ‘de’ as $slug, which results in an error when trying to return page($slug).
Is my concept wrong on this, or is this a bug in Kirby?
Thanks in advance for your help!