$field->isTranslated($lang = null)
- since: Kirby 2.3.0
A field value is considered as translated if it is not empty and is not equal to the field value of the default language.
$field->isTranslated() will always return
true for the default language as well as for single language setups.
<?php if($page->description()->isTranslated()): ?> <h2>Description</h2> <?= $page->description()->kirbytext() ?> <?php endif ?>
Check for a specific language
By passing a language code as the
$lang parameter, you can check for a translation in that language:
<?php if($page->description()->isTranslated('de')): ?> // Field 'description' is translated in German <?php endif ?>