0

I created matrix field, put it in the user field. In the front-end page as usually write

{% for block in user.myMatrixfield.type('myType') %}
   ................
{% endfor %}

but there is no output! try to write {% user.myMatrixfield|length %} - outputs 0

In administration panel everything works. How to get matrix field in user-profile front-end page?

2
  • How are you setting the user variable? Can you supply the template code for the page?
    – Jamie Wade
    Commented Oct 15, 2014 at 6:30
  • way for the user does not need the same variable, the user simply Commented Oct 15, 2014 at 11:21

2 Answers 2

1

It works identically to entries.

Here are a couple things you can do to troubleshoot:

  • Make sure that user is set to the user account you’re expecting it is. You can double check that by outputting {{ user.username }}.

  • Make sure that you’re calling the right Matrix field handle, with the correct capitalization.

  • If you’re passing the type param, make sure you’re passing in the right Block Type handle.

1

Oh, sorry, I forgot to put the original values in administration panel. That is, I did not push +myMatrixfield and it turns out that the matrix field does not exist.

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.