Trying to template a matrix field that contains the use of categories. I am not a dev but trying to get this working. This is my attempted but what I get back is something like this instead of the result.


Here is my code...

{% set entries = craft.entries.section('bizlist').limit(10) %}
  {% for entry in entries %}
{{ entry.title }}<br />
     {% for block in entry.cityList %}
{{ block.bizName }}
     {% endfor %}
  {% endfor %}

Is bizName your categories field? Try something like:

{% for category in block.bizName.all() %}
   {{ category.title }}
{% endfor %}
  • I got this one covered by using .one() also.
    – Vin
    May 9 '18 at 0:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.