PHPackages                             storypioneers/kirby-selector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. storypioneers/kirby-selector

AbandonedArchivedKirby-plugin[Utility &amp; Helpers](/categories/utility)

storypioneers/kirby-selector
============================

v1.5.3(8y ago)0774PHP

Since Jan 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/blankogmbh/kirby-selector)[ Packagist](https://packagist.org/packages/storypioneers/kirby-selector)[ RSS](/packages/storypioneers-kirby-selector/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Selector – Kirby Fileselect Field
=================================

[](#selector--kirby-fileselect-field)

This additional panel field for [Kirby 2](http://getkirby.com) allows you to use an intuitive alternative file selection field in your blueprints.

**Authors**: [digital storytelling pioneers](https://github.com/storypioneers) feat. [Jonas Doebertin](https://github.com/JonasDoebertin)

**License**: [GNU GPL v3.0](http://opensource.org/licenses/GPL-3.0)

[![Screenshot](https://raw.githubusercontent.com/storypioneers/kirby-selector/master/screenshot.png)](https://raw.githubusercontent.com/storypioneers/kirby-selector/master/screenshot.png)

Installation
------------

[](#installation)

Copy or link the `kirby-selector` directory to `site/plugins/`**or** `composer require storypioneers/kirby-selector`**or** use the [Kirby CLI](https://github.com/getkirby/cli) `kirby plugin:install storypioneers/kirby-selector`.

Usage
-----

[](#usage)

### Within your blueprints

[](#within-your-blueprints)

Post installation simply add `selector` fields to your blueprints and set some options (where applicable).

```
fields:
	postimage:
		label: Main Post Image
		type:  selector
		mode:  single
		types:
			- image
```

```
fields:
	attachments:
		label: Post Attachments
		type:  selector
		mode:  multiple
		types:
			- all
```

### Within your templates / controllers / models

[](#within-your-templates--controllers--models)

As per design, the selector field stores the *filenames* of the selected files, only. If you need access to the files full path or to other properties / functions of the file object, you must convert the filename into a full file object first.

**Single Mode**

When you're using the Selector field in Single Mode, gaining access to the full file object is quite easy. Just replace `yourselectorfield` with the name of your Selector-based field.

```
	// Convert the filename to a full file object
	$file = $page->yourselectorfield()->toFile();

	// Use the file object
	echo $file->url();
```

**Multiple Mode**

In multiple mode, the Selector field stores a comma-separated list of filenames, based on how many files you selected. To convert this list into a fully-featured file collection (just like `$page->files()`), you need a bit more code.

```
	// Transform the comma-separated list of filenames into a file collection
	$filenames = $page->yourselectorfield()->split(',');
	if(count($filenames) < 2) $filenames = array_pad($filenames, 2, '');
	$files = call_user_func_array(array($page->files(), 'find'), $filenames);

	// Use the file collection
	foreach($files as $file)
	{
		echo $file->url();
	}
```

Options
-------

[](#options)

The field offers some options that can be set on a per field basis directly from your blueprints.

### mode

[](#mode)

Define a mode the field will work in. Possible values are `single` and `multiple`.

- **single**: With the `single` mode, the fields checkboxes will work like a set of radio buttons, letting you select a single file only. This is useful if you want a way to specify a posts main image.
- **multiple**: This option allows you to select multiple files in a single file selector field. The selected files will be stored as a comma separated list.

### types

[](#types)

Define the files types the file selector field shows. Possible values are `all`, `image`, `video`, `audio`, `document`, `archive`, `code`, `unknown`. You may specify as many of these types as you like.

```
fields:
	attachments:
		label: Post Attachments
		type:  selector
		mode:  multiple
		types:
			- image
			- video
			- audio
			- document
```

### sort

[](#sort)

Files will be shown sorted by their filename in ascending order (a-z). However, this option let's you change the default sort behavior. You can sort files by filesize, dimensions, type and many more. Some of the countless possible values are `sort`, `filename`, `size`, `width`, `height`, `type`, `modified`, `ratio`. You can also sort by any of your custom [file fields](http://getkirby.com/docs/panel/blueprints/file-settings#file-fields). The value `sort` will make sure the files are presented in the exact order you specified in the panels file section via [drag and drop](http://getkirby.com/docs/panel/blueprints/file-settings#sortable-files).

```
fields:
	featured:
		label: Featured Image
		type:  selector
		mode:  single
		sort:  size
		types:
			- image
```

### flip

[](#flip)

This options allows you to reverse the sort order you specified with the `sort` option. You may set this to `true` or `false`.

### autoselect

[](#autoselect)

This options allows you to tell the Selector to auto select the first, last or all files of the list, if no other file is selected, yet. Possible values are `none` (default), `first`, `last` and `all`.

```
fields:
	featured:
		label:      Featured Image
		type:       selector
		mode:       single
		sort:       filename
		autoselect: first
		types:
			- image
```

### filter

[](#filter)

This options allows you to set a filename filter. This can be either a simple string or a fully featured regular expression. Only files with filenames matching the filter string or regular expression will be shown in the Selector field. You may set this to any string like `background`, `.min.js` or `large` or a regular expression like `/\.((png)|(jpe?g))/i`.

```
fields:
	featured:
		label:  Page Background Image
		type:   selector
		mode:   single
		filter: background
		types:
			- image
```

Showing only image files with the term *background* in their filename.

```
fields:
	featured:
		label:  Page Background Image
		type:   selector
		mode:   single
		filter: /\.((png)|(jpe?g))/i
```

Using a regular expression to show only *.jpg*, *.jpeg* and *.png* files.

### size

[](#size)

The `size` option lets you limit the height of the selector field and makes it scrollable. Only the specified number of files will be shown initially. This can be set either to a *number* or to `auto` (the Selector field will adapt to the height of the complete list of files).

```
fields:
	featured:
		label: Page Background Image
		type:  selector
		mode:  single
		size:  4
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 86.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3079d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/498197?v=4)[Pascal Küsgen](/maintainers/Pascalmh)[@Pascalmh](https://github.com/Pascalmh)

---

Top Contributors

[![JonasDoebertin](https://avatars.githubusercontent.com/u/1367270?v=4)](https://github.com/JonasDoebertin "JonasDoebertin (85 commits)")[![dgdsp](https://avatars.githubusercontent.com/u/293852?v=4)](https://github.com/dgdsp "dgdsp (9 commits)")[![amustill](https://avatars.githubusercontent.com/u/448157?v=4)](https://github.com/amustill "amustill (2 commits)")[![medienbaecker](https://avatars.githubusercontent.com/u/7975568?v=4)](https://github.com/medienbaecker "medienbaecker (1 commits)")[![Pascalmh](https://avatars.githubusercontent.com/u/498197?v=4)](https://github.com/Pascalmh "Pascalmh (1 commits)")

### Embed Badge

![Health badge](/badges/storypioneers-kirby-selector/health.svg)

```
[![Health](https://phpackages.com/badges/storypioneers-kirby-selector/health.svg)](https://phpackages.com/packages/storypioneers-kirby-selector)
```

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)[mautic/core

Mautic Open Source Distribution

9.8k2.6k9](/packages/mautic-core)[mediawiki/maps

Adds various mapping features to MediaWiki

78149.7k3](/packages/mediawiki-maps)[rainlab/blog-plugin

Blog plugin for October CMS

17158.6k](/packages/rainlab-blog-plugin)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

19246.3k2](/packages/civicrm-civicrm-drupal-8)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3355.8k](/packages/starcitizentools-citizen-skin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
