Where are "documents" defined?

As I was working on my website an trying to give my students some templates, I found out, that kirby is not recognising .pptx as a document file. I fixed it, but i was not able to find the line in the source, where the filetypes for documents are set, so it was a quite rough way around.

<?php foreach($page->documents()->filterBy('extension', 'pptx') as $pptx): ?>
	<li class="ppt">
		<a href="<?php echo $pptx->url() ?>">
			<?php echo $pptx->filename() ?> (<?php echo $pptx->niceSize() ?>)
		</a>
	</li>
<?php endforeach ?>

this does not work, but if I replace “documents” by “files”, it works as expected. Does anyone know, where I can define my types of documents?

They are defined in the toolkit in lib/f.php. See here: https://github.com/getkirby/toolkit/blob/765c3160c0ee3f35d57bbf99980190ddb9a28f5f/lib/f.php

Lines 17-112 pair extensions with MIME types and lines 115-203 categorize them into the document types. For a quick fix. But I will also look if we can add the ‘pptx’ - just have to check out the mime identifier

Could you please check if it works with this version of the kirby/toolkit/lib/f.php?

https://github.com/distantnative/toolkit/blob/c398cd1a991d516d45ad40d483e34d0bf1cf436e/lib/f.php

thank you!

tried your modification, but just got a white page of death :frowning:

Weird, you sure you copied the whole file to the right place?
https://raw.githubusercontent.com/distantnative/toolkit/c398cd1a991d516d45ad40d483e34d0bf1cf436e/lib/f.php

Cause at my setup it works and also detects the right type now:

my fail. did something different stupid in another file. works fine! thank you!

Great. Already asked to get it included for the next toolkit version.