I'm having a difficult time with what seems like a fairly straightforward problem:
I'm listing businesses and their related hours of operation (days/times). I'd like to set up a conditional statement that checks if a Matrix field has content—if so, display hours. If not, display message. My code is as follows:
{% if entry.hours.block('days')|length %} <!-- I am trying to check Matrix field "days" is empty (content exists) -->
<div class="entry__hours">
<table>
<tbody>
{% for block in entry.hours %}<!-- Loop through days/times...this part works fine -->
<tr>
<td class="entry__days">{{ block.days }}</td>
<td class="entry__times">{{ block.times }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %} <!-- This part does not show up if Matrix field "days" is empty -->
<p>We're still trying to track down hours.</p>
{% endif %}
I've also attached a screenshot of my Matrix setup. Thanks so much in advance]1