<p>Nevermind, the problem is solved.</p>

<p>I just need to loop over the categories.</p>

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

CC BY-SA 4.0
2020-05-05T11:12:36.420Z
2020-05-05T11:12:36.420Z
John Stevens
<p>Me and categories, always giving trouble :)</p>

<p>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.</p>

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

<p>The outcome is empty ...</p>

<p>What do I miss?</p>

<craft3><matrix><categories><field><category>
Matrix-field with a category-field to output category-title on single entry page
# Matrix-field with a category-field to output category-title on single entry page

(Asked by: username_0 on 2020-05-05)

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 %}
 
  
    {% set merk = block.merkNaam %}
    {{ merk.title }}
      
 
{% endblock %}

The outcome is empty ...
What do I miss?

**Tags:** craft3, matrix, categories, field, category

---

## 1 answers

### Answer by username_0 on 2020-05-05. Score: 1

Nevermind, the problem is solved.
I just need to loop over the categories.
{% extends "matrix/default" %}
{% block blockContent %}

    
        {% for merk in block.merkNaam %}
            {{ merk.title }}
        {% endfor %} #}
      

{% endblock %}


---

