Hide page in one language

If I have a site in two languages. Can I add a page in one language and hide it in another?

Yes, you can check if a translation exists with this code:


This is how your menu could look like with two languages:

  $otherLanguage = $kirby->languages()->not($kirby->language())->first();
  foreach($pages->listed() as $p):
  if(!$p->translation($otherLanguage->code())->exists()) continue;
  <a href="<?= $p->url() ?>">
    <?= $p->title() ?>
<?php endforeach ?>