1

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.

enter image description here

enter image description here

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?

1 Answer 1

1

Well, many tries later, I found a way to do it.

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

It is as simple as that :)

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.