Very new to craft and hence sorry if this is very basic. I have created a service channel which contains some matrix fields. One for a list and one for button. My approach here may be wrong and hence please say if that is case. I appear to be in my service loop as the title and excerpt are outing, However, the matrix fields are not?
If I {% dd serviceEntry %}
this shows [serviceList] => null
which perhaps explains why the isn't outputting, but not why the fields are null
?
<div class="service card">
{% for serviceEntry in craft.entries.section('service').limit(3).all() %}
<h1>{{ serviceEntry.title }}</h1>
<p>{{ serviceEntry.excerpt }}</p>
{% for block in entry.serviceList %}
<ul>
{% switch block.type %}
{% case 'list' %}
{% set item = block.item.one() %}
<li>{{ block.item }}</li>
{% endswitch %}
</ul>
{% endfor %}
<ul>
{% for block in entry.serviceList %}
{% if block.type == "list" %}
<li>{{ block.item }}</li>
{% endif %}
{% endfor %}
</ul>
{% endfor %}
</div>
Above are both the methods I have tried, neither of which work.
Handle: ServiceList
Field Type: Matrix
Block types: List
Fields: Item