# File section filter only documents

**URL:** <https://forum.getkirby.com/t/file-section-filter-only-documents/15397>\
**Category:** Questions\
**Tags:** v3\
**Created:** [August 25, 2019, 9:57pm UTC](https://forum.getkirby.com/t/file-section-filter-only-documents/15397 "2019-08-25T21:57:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![guidoferreyra](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/guidoferreyra/32/12544_2.png) [@guidoferreyra](https://forum.getkirby.com/u/guidoferreyra)\
**Post date:** [August 25, 2019, 9:57pm UTC](https://forum.getkirby.com/t/file-section-filter-only-documents/15397/1 "2019-08-25T21:57:12Z")

</div>

Hi everyone! Is possible in a files section filter by type of file? I want to only display documents not images. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 25, 2019, 10:25pm UTC](https://forum.getkirby.com/t/file-section-filter-only-documents/15397/2 "2019-08-25T22:25:54Z")

</div>

Yes, that’s possible. You need to assign a template to the files section and in that files blueprint, set the `accept` option.

```auto
sections:
  docs:
    headline: My documents
    type: files
    template: docs

```

In `/site/blueprints/files/docs.yml`

```auto
title: Documents

accept: application/pdf # comma separated list of accepted mime types

```

> **[File blueprint](https://getkirby.com/docs/reference/panel/blueprints/file#accept)**
>
> File blueprints are located in /site/blueprints/files and control the Panel setup and form fields for individual file types.

---

<div class="post-metadata">

**Author:** ![guidoferreyra](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/guidoferreyra/32/12544_2.png) [@guidoferreyra](https://forum.getkirby.com/u/guidoferreyra)\
**Post date:** [August 26, 2019, 1:55am UTC](https://forum.getkirby.com/t/file-section-filter-only-documents/15397/3 "2019-08-26T01:55:56Z")

</div>

Oh thanks! I didn’t new about accept option on file blueprint.

You are the best @texnixe!

---

<div class="post-metadata">

**Author:** ![wdebusschere](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/wdebusschere/32/11898_2.png) [@wdebusschere](https://forum.getkirby.com/u/wdebusschere)\
**Post date:** [August 30, 2022, 9:25am UTC](https://forum.getkirby.com/t/file-section-filter-only-documents/15397/4 "2022-08-30T09:25:26Z")

</div>

Why is it not possible to use query: page.documents

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 30, 2022, 11:30am UTC](https://forum.getkirby.com/t/file-section-filter-only-documents/15397/5 "2022-08-30T11:30:16Z")

</div>

In a files section you cannot use queries. You can only filter by template (however, you can use a separate template for a files section that only allows uploading documents and filter that way).

As an alternative, there’s also my [GitHub - texnixe/k3-filesdisplay-section](https://github.com/texnixe/k3-filesdisplay-section) plugin.

---

<div class="post-metadata">

**Author:** ![wdebusschere](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/wdebusschere/32/11898_2.png) [@wdebusschere](https://forum.getkirby.com/u/wdebusschere)\
**Post date:** [September 1, 2022, 3:02pm UTC](https://forum.getkirby.com/t/file-section-filter-only-documents/15397/6 "2022-09-01T15:02:15Z")

</div>

Ok. Is it possible to display a usagecount here? Count = if the files are used in a txt.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 1, 2022, 4:30pm UTC](https://forum.getkirby.com/t/file-section-filter-only-documents/15397/7 "2022-09-01T16:30:43Z")

</div>

Yes, you can achieve this with a custom method. Depending on where you use the files (e.g. in a textarea field via a kirbytag) that would require some text parsing though).
