<p>Well, many tries later, I found a way to do it.</p>

<pre><code>{% for block in currentUser.certificado %}
&lt;div&gt;
    &lt;h3&gt;{{ block.nomeDoCertificado }}&lt;/h3&gt;
    &lt;h3&gt;{{ block.curso[0] }}&lt;/h3&gt;
    &lt;a href="{{ block.certificado[0].url }}" target="_blank"&gt;{{ block.nomeDoCertificado }}&lt;/a&gt;
&lt;/div&gt;
{% endfor %}
</code></pre>

<p>It is as simple as that :)</p>

CC BY-SA 4.0
2019-04-17T10:56:12.850Z
2019-04-22T22:42:26.327Z
2019-04-22T22:42:26.327Z
André Castro
<p>I have a Matrix field named -> <code>certificado</code></p>

<p>with block -> <code>certificados</code></p>

<p>and fields -> <code>nomeDoCurso</code>, <code>curso</code>, <code>certificado</code></p>

<p>My Matrix block has no entries but is associated with a user.</p>

<p><a href="https://i.sstatic.net/IVJUy.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/IVJUy.png" alt="enter image description here"></a></p>

<p><a href="https://i.sstatic.net/5rRXd.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/5rRXd.png" alt="enter image description here"></a></p>

<p>How can I fetch the content of the Matrix block for a particular user in the frontend?</p>

<p>I'm trying with:</p>

<pre><code>{% for item in currentUser.certificado %}
    {{ dump(item) }}
{% endfor %}
</code></pre>

<p>But this is wrong.</p>

<p>How can I do it?</p>

<craft3><matrix><loop><current-user>
Craft 3 - Matrix Block for currentUser
# Craft 3 - Matrix Block for currentUser

(Asked by: username_0 on 2019-04-17)

I have a Matrix field named -> certificado
with block -> certificados
and fields -> nomeDoCurso, curso, certificado
My Matrix block has no entries but is associated with a user.


How can I fetch the content of the Matrix block for a particular user in the frontend?
I'm trying with:
{% for item in currentUser.certificado %}
    {{ dump(item) }}
{% endfor %}

But this is wrong.
How can I do it?

**Tags:** craft3, matrix, loop, current-user


---

## 1 answers

### Answer by username_0 on 2019-04-17. Score: 1

Well, many tries later, I found a way to do it.
{% for block in currentUser.certificado %}

    {{ block.nomeDoCertificado }}
    {{ block.curso[0] }}
    {{ block.nomeDoCertificado }}

{% endfor %}

It is as simple as that :)


---

