1

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.

{{%content}}";s:12:"customFields";N;s:9:"inReverse";b:0;s:7:"asArray";b:0;s:2:"id";N;s:3:"uid";N;s:10:"fixedOrder";b:0;s:6:"status";a:1:{i:0;s:7:"enabled";}s:8:"archived";b:0;s:11:"dateCreated";N;s:11:"dateUpdate

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 %}
2

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.