Temporarily disable language in front end

A client’s website is multilingual with 3 languages. They want 2 of those languages already activated when launching the website. The 3rd language won’t be online for some time. They already want to fill in the translated content for the 3rd language but just not display it as a language option for visitors on the website.

Best case would be: the website launches with 2 languages and whenever they’re ready with the 3rd language they email me and I activate it. So, is it possible to temporarily disable language in the front end but keep it in the back end?

Do simply I use without() and the language code?

Lol, ok sorry, my question can be deleted or marked solved, it’s simply I use without() and the language code.
Awesome!

1 Like

You might additionally want to use a route to redirect any pages of that language that are not in draft state from being indexed or accessed.

1 Like

Thanks for the tip with the routing!

Also language related: if I have multiple languages but for one field only want to output the translation of a specific language, does something like this exist?

<?php foreach($page->markers()->translation('de')->toStructure() as $marker): ?>

or something like:

<?php foreach($page->translation('de')->markers()->toStructure() as $marker): ?>

The content() page method accepts a language code:

<?php foreach($page->content('de')->markers()->toStructure() as $marker): ?>
1 Like

Wow, thanks for the quick reply!

Sorry to bring it back up, but where and how would you use without() exactly? Thanks!

without() is a collection method. You would use it when you loop through the languages to create your language navigation:

$languages = $kirby->languages()->not('de');

(not() is the same as without())

1 Like