Stuck on a problem at the moment… trying to output a Rich Text field (copy) from an entry. The copy is contained in a matrix field (so: Entry -> Matrix Field -> Copy Field) but I can’t access it no matter what I try.
The Matrix Field Type is genericContent
, the entry is relatedContent
and the copy field is simply named copy
.
Here's the code I currently have, I've tried various other options but none work.
{% set entries = entry.relatedContent %}
{% for entry in entries %}
{% switch entries|length %}
{% case '1' %}
one
{% case '2' %}
<article class="t{% if loop.first %} t--tall{% endif %}">
<div class="content">
<span class="subtitle">{{ entry.sectionTag.first }}</span>
<h1>{{ entry.title }}</h1>
<p>{{ entry.genericContent.copyMatrix.copy.first }}</p>
</div>
</article>
<pre>{{dump(entry.genericContent.copyMatrix.copy.first)}}</pre>
<br>
{% case '3' %}
three
{% case '4' %}
four
{% endswitch %}
{% endfor %}