1

I can successfully use the Preparse field type to display matrix fields in the control panel, however, the output is very limited. Even my
tag is stripped out.

Is there any way to do this short of writing a plug-in?

And if not, what is the simplest possible plug-in I could use as a base for this.

{% for thing in entry.myMatrixField%}
  {{ thing.item }} - {{ thing.amount|number_format(2, '.', ',') }}<br>
{% endfor %}

1 Answer 1

2

There may be a better answer, but this is what I have come up with. Using Control Panel JS, combined with Preparse field(s), I am adding characters in like this

{% for thing in entry.myMatrixField %}
  {{ thing.item }} - {{ thing.amount|number_format(2, '.', ',') }}^
{% endfor %}

And then using some basic jQuery to replace the ^ character with a line break. It's a bit clumsy, but it works. Now I can get Matrix fields to display in the control panel. Items, Budget line, Prices are all fields within my Matrix block. Just have to get them out separately. enter image description here

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.