$field->isEmpty()

Checks if the field is empty

  • return (boolean)

Example

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