<?php if (!$field->hidden): ?>

    <?php if (!$this->showFieldLabels($field)): ?>

        <?= $this->renderFieldElement($field) ?>

    <?php else: ?>

        <?php if ($field->label): ?>
            <label for="<?= $field->getId() ?>">
                <?= e(trans($field->label)) ?>
            </label>
        <?php endif ?>

        <?php if ($field->comment && $field->commentPosition == 'above'): ?>
            <p class="help-block before-field"><?= e(trans($field->comment)) ?></p>
        <?php endif ?>

        <?= $this->renderFieldElement($field) ?>

        <?php if ($field->comment && $field->commentPosition == 'below'): ?>
            <p class="help-block"><?= e(trans($field->comment)) ?></p>
        <?php endif ?>

    <?php endif ?>

<?php endif ?>