GithubHelp home page GithubHelp logo

tobiasfabian / k3-filesdisplay-section Goto Github PK

View Code? Open in Web Editor NEW

This project forked from texnixe/k3-filesdisplay-section

0.0 1.0 0.0 7 KB

Kirby 3 plugin to display any file in a section.

JavaScript 6.02% PHP 93.98%

k3-filesdisplay-section's Introduction

Kirby 3 Filesdisplay Section

Display files from anywhere in your site in a section.
This section only displays files, you cannot sort them manually or upload new files.

Installation

Download zip file

Copy the plugin folder into site/plugins

Composer

Run composer require texnixe/k3-filesdisplay-section.

Usage

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).

Examples

Basic example

By default, the filesdisplay section will display all files of the current page.

sections:
  files:
    headline: Audio files
    type: filesdisplay

Filter by file type

For example, get all audiofiles in the index:

sections:
  files:
    headline: Audio files
    type: filesdisplay
    query: site.index.audio

Filter by single template

sections:
  files:
    headline: Audio files
    type: filesdisplay
    query: site.index.files.template("image")

Filter by multiple templates

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.

Disclaimer

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.

License

MIT

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.

Credits:

Based on the K3-Pagesdisplay plugin

k3-filesdisplay-section's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.