Download the PHP package presprog/kirby-auto-file-templates without Composer

On this page you can find all versions of the php package presprog/kirby-auto-file-templates. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kirby-auto-file-templates

Automatically assign templates to your uploaded files

⚡ Ready for Kirby 4!

This plugin automatically assigns file templates to your uploaded files, based on the respective file type. This way it does not matter, which file type you upload from which field or section – the template assigned will always be the same. This is especially handy, when you use a single files section per page, that stores all the different file types used on the page.

[!IMPORTANT] Requires at least Kirby 4.0 and PHP 8.2

🚀 How to use

Set up your configuration (see next section) first. The plugin will then run after each uploaded file (file.create:after hook) and assign the configured template automatically.

If you add the plugin to an existing project, you can run the auto-templates command from the CLI. It will iterate over every file in every page and assign the template according to the configuration:

By default, existing template assignments will not be touched. To change that, run the command with --force/-f or set the forceOverwrite option globally in your config.php (see below).

⚙️ Config

The plugin works in an opt-in manner: It does nothing except you tell it to.

With autoAssign = true, each file type will get the identically named file blueprint assigned as template:

File type File blueprint
audio site/blueprints/files/audio
archive site/blueprints/files/archive
code site/blueprints/files/code
image site/blueprints/files/image
video site/blueprints/files/video
your-type site/blueprints/files/your-type

* The Kirby core file types archive, audio, document, image and video and your custom file type extensions are supported out-of-the-box.

💻 How to install

Install this plugin via Composer (recommended):

Or download the ZIP file from GitHub and unpack it to site/plugins/kirby-auto-file-templates

Or as Git submodule

✅ To do

📄 License

MIT License Copyright © 2024 Present Progressive


Made by Present Progressive for the Kirby community.


All versions of kirby-auto-file-templates with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
getkirby/composer-installer Version ^1.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package presprog/kirby-auto-file-templates contains the following files

Loading the files please wait ....