Display files from anywhere in your site in a section.
This section only displays files, you cannot sort them manually or upload new files.
Copy the plugin folder into site/plugins
Run composer require texnixe/k3-filesdisplay-section
.
Select and filter files using Kirby's query language, with a query
property in the section yaml.
You can start the query with site
, page
(refers to the current page), or pages
(which is equal to site.pages
).
By default, the filesdisplay
section will display all files of the current page.
sections:
files:
headline: Audio files
type: filesdisplay
For example, get all audiofiles in the index:
sections:
files:
headline: Audio files
type: filesdisplay
query: site.index.audio
sections:
files:
headline: Audio files
type: filesdisplay
query: site.index.files.template("image")
sections:
files:
headline: Audio files
type: filesdisplay
query: site.index.files.filterBy("template", "in", ["image", "video"])
Apart from manual sorting, you can use the same properties that are available for standard files sections.
This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.
It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia animal abuse, violence or any other form of hate speech.
Based on the K3-Pagesdisplay plugin