$field->isNotEmpty()

Checks if the field is not empty

  • return (boolean)

Example

<?php if($page->address()->isNotEmpty()): ?>
  <h2>Address</h2>
  <?php echo $page->address()->kirbytext() ?>
<?php endif ?>