Hey there everybody. In one of my template partials, i want to print out (html) a list of files. That already works well for all the zip files i add to the post / pages folder. But i would love to have the count of the attached files showing in the header - wich i tried with .length and .count. But neither one gives me any output. What am i doing wrong?
{% set attachementList = page.media.files() %}
{% set attachementCount = attachementList.length() %}
{% if attachementList %}
<h3>{{ attachementCount }} Anhänge (Downloads)</h3>
<ul>
{% for mediaItem in page.media.files %}
<li><a href="{{mediaItem.url}}">{{mediaItem.text}}</a></li>
{% endfor %}
</ul>
{% endif %}
---