0

Is there an easy way to return the total number of entries in a Super Table within a Matrix field?

2

You mean how many rows the table has?

{{ matrixblock.superTableFieldHandle|length }}

Or the number of blocks of a matrix field?

{{ parent.matrixFieldHandle|length }}

To get the number of blocks for each row

{% for row in entry.superTableMatrix %}
    {{ row.matrix|length %}
{% endfor %}
| improve this answer | |
  • Is there anyway to get all the records listed in the SuperTable across each Matrix entry within the Entry. I am not sure if I am saying that correct. Basically I have 4 matrix records and within one of the matrix blocks there is a SuperTable and there would be 5-100 records in thost SuperTables. So combined could be 20-400 lines since the SuperTable is a text field. – Vin Apr 23 '18 at 22:37
  • Basically need the total count for all those SuperTable entries for each Entry. – Vin Apr 23 '18 at 22:38
  • 1
    You can loop through each field and add the number for each element – Robin Schambach Apr 23 '18 at 22:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.