I have a template that lists media files of a directory in a table and allow downloading them this way. Up to now I just used it for pdf documents and it worked quite well.
Now I want to extend this to also show non-media files, e.g. LibreOffice odt documents and unknown media formats, e.g. mkv containers. At the moment it doesn’t even work with mp3 files, although they should be detected as media. I didn’t change anything in the Grav default media.yaml config.
A simple
{% for file in page.media.files %}
<p>{{ file }}</p>
{% endfor %}
only shows known media files (e.g. pdf or svg), but no odt/mp3/mkv.
Try debugging what’s in page.media and you will quickly see which key holds all of the attachments to page. Sadly I currently don’t have Grav set up on my fresh PC install so I could check myself
in the debugbar. Additionally in items I can see some details about the 3 svg files, but nothing else. It seems strange that it says accept => image/*. On the other hand it also shows the same, if I only have pdfs in the folder, but the pdfs are properly iterated.
Edit: I just saw that the accept => image/* is for file uploading.