👩‍💻👨‍💻 We are a new team company! Learn more
Skip to content

Choices

foreach ($page->fruits()->toChoices() as $fruit) {
    echo $fruit;
}

Choices is a plugin that provides methods to manage field options in the frontend. For any field – like select, multiselect or checkboxlist – that offers options settings in the blueprint, this plugin will load and return the readable text values for the keys stored in the content file. It works with static options directly set in the blueprint as well as dynamic ones loaded via query or api settings.

Related plugins

Other plugins by hana+nils

Colors

by hana+nils

Colors is a field that allows the selection of a color using the native color selector. Colors can be viewed and edited in either HEX, RGB …
$page
  ->date()
  ->toDateTime()
  ->modify('+1 month')
  ->format('Y-m-d');

Date Methods

by hana+nils

Date Methods is a plugin that allows for advanced date and time parsing and formatting using PHP's core date objects. It offers methods for …
// using the username
$users->toList();

// using the page title
$pages->toList();

// using the filename
$files->toList();

List Methods

by hana+nils

List Methods is a plugin providing methods to generate comma-separated list from collections like pages, users or files. It allows for …
site
└ methods
  └ file.php
  └ page.php
  └ site.php
  └ user.php

Methods Folder

by hana+nils

Methods Folder is a plugin to automatically register local methods provided in the folder site/methods just like Kirby accepts local …
snippetWhen('article', $category->isNotEmpty())

snippetWhen Helper

by hana+nils

snippetWhen is a helper function to conditionally embed snippets.

Structure: Textarea Preview

by hana+nils

Structure: Textarea Preview offers Markdown previews for textareas in structure fields.

Tiles

by hana+nils

Tiles is a plugin to serve basic vector map tiles (.mbtiles). The plugin provides routes for styles, tilejson and vector tiles that can be …
<?php foreach ($notifications as $notification): ?>
  <li>
    <?= $notification
      ->track()
      ->toReference()
      ->title() ?>
  </li>
<?php endforeach ?>

Tracker

by hana+nils

Tracker is a plugin to track content changes and create panel logs or front-end notifications in member areas.
<?= $page->text()->toTree()->level(3) ?>

Tree Methods

by hana+nils

Tree Methods converts field values to HTML and helps adapting the resulting markup by changing headline hierarchy, wrapping and filtering …
$object->isPage();
$object->isUser();
$object->isFile();
$page->isType('article');

Type Methods

by hana+nils

Type Methods is a plugin helping to identify the type of an object, either page, user or file, in order to simplify logic in snippets that …

XSLT Templates

by hana+nils

Template component for XSLT support in your templates. It let's you specify the needed data for each blueprint which is then provided as …