With this code I'm trying to display an event date that has a beginning and ending date, but sometimes there is only one beginning date.
If there is a beginning and ending date i need this displayed: DU 10 JUILLET 2017 AU 10 JUILLET 2017
And if there is only a beginning date, i need this displayed: LE 10 JUILLET 2017 (the "DU" is replace by "LE")
<?php if (isset($this->item->jcfields[3]) && !empty($this->item-jcfields[3])):
?>Du
<?php echo FieldsHelper::render('com_content.article', 'field.render',
array('field'=> $this->item->jcfields[3])); ?>
<?php endif; ?>
<?php if (isset($this->item->jcfields[7]) && !trim($this->item-
>jcfields[7])): ?>Au
<?php echo FieldsHelper::render('com_content.article', 'field.render',
array('field'=> $this->item->jcfields[7])); ?>
<?php endif; ?>