1

Me and categories, always giving trouble :)

On blogs, we are using a matrix field and in one of the matrix-types, I have a category field. This is to output the title of the category.

{% extends "matrix/default" %}
 {% block blockContent %}
 <div class="row">
  <div class="col flexcntr">
    {% set merk = block.merkNaam %}
    {{ merk.title }}
  </div>    
 </div>
{% endblock %}

The outcome is empty ...

What do I miss?

0

1 Answer 1

1

Nevermind, the problem is solved.

I just need to loop over the categories.

{% extends "matrix/default" %}
{% block blockContent %}
<div class="row">
    <div class="col flexcntr">
        {% for merk in block.merkNaam %}
            {{ merk.title }}
        {% endfor %} #}
    </div>  
</div>
{% endblock %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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