I have a Matrix field which contains a bunch of blocks. If only one matrix field is present in the entry I need it to show a message. If more then one matrix field show an other message.
Below is my current code.
{% for block in entry.modelIds.limit(1) %}
{% if block.modelId|length == 1 %}
I am link - {{block.modelId}} <br>
{% else %}
Not a Link - {{block.modelId}}<br>
{% endif %}
{% endfor %}
Any help would be appreciated. I have tried a few different approaches and am just stumped.
Thanks!
modelIds
is the Matrix field, what type of field ismodelId
?