I have a field (named = “extract”) associated to a page. This field content is supposed to be displayed within the sidebar of the page template.
Some pages have this field filled with content, some other pages have this field blank.
How could I manage to display this field only if the field is not empty (through the template or elsewhere)?
My current code in the template is :
<div><input class="toggle-box" id="identifier-2" type="checkbox" > <label for="identifier-2">Extrait</label> <div><?php echo $page->extract()->kirbytext() ?></div> </div>
I would like to have this
<div> displayed only if not empty.
Thank you in advance