Default template problem on multilingual website since Kirby 2.3

There was very a similar topic but it’s already closed.

With the default language set to French, and without an “example.fr.txt” inside a folder, Kirby 2.3+ uses the “default” template instead of “example” template. Or pages are not necessarily available in the default language !

How to force Kirby to use dedicated templates every time they are available, as it was before v2.3 ?

A global workaround would be welcome as I have hundreds of pages that stopped to be correctly rendered since update.

1 Like

Hello @kris
can you show the content of a folder? A workaround might be as simple as renaming the files in batch :wink:

In the other topic the issue was that the text file of the default lang had the name example.txt without the language code. If I understand you correctly, it seems like your issue is that you don’t have a text file of the default language at all.

While this is an unsupported configuration (the text file of the default lang must exist), I agree that this is a bug and I have moved this to an issue on GitHub. We will look into this for 2.4.

Thanks. Awaiting Kirby 2.4, I will downgrade, if there is no other solution.

The best way in general would be to create empty text files for the default language.

Quite ingenious (!!) but it will false the xmlsitemap as well as what menus show as available translation. At the very end, I would get lost myself :wink:

I have had a similar problem before that some pages are only available in some languages. You can solve this by adding a checkbox to the blueprint that defines whether the current language of the page is translated or not. You can then exclude pages without that property in your templates.

@flokosiol plans to add a similar feature to his Translation field.

Thanks, lukasbestle. All this will be helpful one day. Actually I use a table that lists all the pages side by side. Not ingenious but works fine since Kirby 2.0.

As for the actual issue, the fun is that the default template echoes right templates names when asked wchich one should be applied.

What was the code you were using to check this? Might be helpful for debugging.

2 functions added to the “templates/default.php” :

echo $page->hasTemplate()
answers : 1
Cheat Sheet : “Checks if the page has its own template or if it uses the default template (return boolean)”.

echo $page->content()->name()
answers : (correct strings)
Cheat Sheet : “Returns the name of the content file without the extension. This is being used to determine the template for the page (return string)”

ps.
intendedTemplate() returns “default”, no surprise

This feature is already implemented in the develop branch and may be pushed to the master soon …

EDIT: Version 0.3 has been released with this feature yesterday.

2 Likes

Kirby 2.4 doesn’t solve the problem.

Yes, that’s true. We moved the GitHub issue to the 2.5 milestone. Sorry for the delay.

Hi,

This bug https://github.com/getkirby/kirby/issues/490 seems not to be part of the 2.5 changelog :disappointed_relieved:

If our default language is not English, we can’t use our custom templates in a Kirby multilingual website.
That means we can’t use the Kirby multilingual feature at all.

You make an amazing work with Kirby and I know you can’t fix all the bugs but customers often ask for a multilingual website. So just to know, is this bug will be fixed in a future (close) release or it is not in your priority?

Sorry, we missed the issue when picking the issues for 2.5. It is currently in the “Future” milestone, which means that it is still on our agenda. :slight_smile:

This is now fixed on the develop branch and will be in the K 2.5.3 release

2 Likes

I love you Kirby team :grinning:

1 Like