PHPackages                             hananils/kirby-link-methods - 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. hananils/kirby-link-methods

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

hananils/kirby-link-methods
===========================

List Methods is a plugin for Kirby providing methods to generate comma-separated list from collections like pages, users or files.

3.0.0(10mo ago)1031MITPHPPHP ^8.2

Since Jun 23Pushed 4mo ago3 watchersCompare

[ Source](https://github.com/hananils/kirby-list-methods)[ Packagist](https://packagist.org/packages/hananils/kirby-link-methods)[ Docs](https://kirby.hananils.de/plugins/list-methods)[ RSS](/packages/hananils-kirby-link-methods/feed)WikiDiscussions main Synced 1mo ago

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

[![Kirby List Methods](.github/title.png)](.github/title.png)

**List Methods** is a plugin for [Kirby](https://getkirby.com) providing methods to generate comma-separated list from collections like pages, users or files. It allows for custom field selection for the list value, optional conjunctions for the last item (e. g. "and") and custom links for each item that can be defined using Kirby's query language (e. g. `{{page.url}}`). It also provides specific methods to list numeric values like years, shortening ranges for better readability.

Note

Please check out the online documentation at [kirby.hananils.de/plugins/list-methods](https://kirby.hananils.de/plugins/list-methods) for further information.

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

[](#installation)

### Download

[](#download)

Download and copy this repository to `/site/plugins/list-methods`.

### Git submodule

[](#git-submodule)

```
git submodule add https://github.com/hananils/kirby-list-methods.git site/plugins/list-methods

```

### Composer

[](#composer)

```
composer require hananils/kirby-list-methods

```

Pages, Users and File Methods
=============================

[](#pages-users-and-file-methods)

There are different options to create lists from users, pages or files collections:

Comma-separated list using the primary field
--------------------------------------------

[](#comma-separated-list-using-the-primary-field)

Creates a list separated all items with a comma:

```
// using the username
$users->toList();

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

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

Creates a list of years:

```
// numeric list, returns "2010–2012, 2022" for "2010, 2011, 2012, 2022"
$page->years()->toNumericList();

// numeric list with "since", return "since 2020" for "2020, 2021, 2022"
$page->years()->toNumericList(true);
```

Comma-separated list using a custom field or method
---------------------------------------------------

[](#comma-separated-list-using-a-custom-field-or-method)

Creates a list separated all items with a comma:

```
// using the custom method `nickname`
$users->toList('nickname');

// using the field category
$pages->toList('category');

// with numeric values
$pages->toNumericList('date');
```

Comma-separated list using a conjunction
----------------------------------------

[](#comma-separated-list-using-a-conjunction)

Creates a list separated all items with a comma but the last which is connected with a cunjunction:

```
// creates, a, list, with, commas and conjunction
$pages->toList('title', true)

// creates, a, list, with, commas & conjunction
$pages->toList('title', '&')
```

The default conjunction `and` is provided in English or German depending on your language settings.

Comma-separated list with dynamic links
---------------------------------------

[](#comma-separated-list-with-dynamic-links)

Creates a list linking to a custom destination:

```
// link everything to the same URL
$pages->toList('title', true, 'https://example.com');

// link all pages to their own URL
$pages->toList('title', true, '{{page.url}}');

// link all pages to a custom URL
$pages->toList('title', true, 'my-custom-path/{{page.category}}');

// link all pages to a custom URL with numeric values
$pages->toNumericList('date', true, 'my-year-overview/{{page.date.toDate('Y')}}');
```

You can use Kirby's template syntax with [query language](https://getkirby.com/docs/guide/blueprints/query-language) to fetch any information from the current context, e. g. the current `$user`, `$page` or `$file` object. The `$kirby` and `$site` objects are also available.

Content methods
===============

[](#content-methods)

When dealing with a single page or user, there are methods to generate lists from content field:

```
// Given the fields name and job, creates "Jane Doe, astrophysicist"
echo $user->asList(['name', 'job']);

// Given the fields start and end, creates "2020–2023"
echo $page->asNumericList(['start', 'end']);
```

Both methods, `asList` and `asNumericList`, support setting a custom conjunction via a secondary attribute:

```
//  Given the fields name and job, creates "Jane Doe: astrophysicist"
echo $page->asList(['name', 'job'], ': ');
```

Collection methods
==================

[](#collection-methods)

The plugin also features a general, more simple collection method which is a shortcut the `naturalList()` helper and only allows for a custom conjunction:

```
// Create a Choices collection for instance, see https://github.com/hananils/kirby-choices
$choices = $page->categories()->toChoices();

// Convert all choices to a comma-separated list
echo $choices->toList();

// Convert all choices to a comma-separated list with the default conjunction
echo $choices->toList(true);

// Convert all choices to a comma-separated list with a custom conjunction
echo $choices->toList('&');
```

Helper
======

[](#helper)

If you'd like to create a list outside of the Kirby objects, from an array for instance, you can use the `naturalList()` helper. It accepts a flat array and a conjunction, there is no custom key selection or template syntax support:

```
$data = ['this', 'that'];

// this, that
naturalList($data);

// this and that
naturalList($data, true);

// this & that
naturalList($data, '&');
```

If you are handling numeric values, you can use the `numericList()` helper:

```
$data = [2019, 2020, 2021, 2022];

// 2019-2022
numericList($data);

// since 2022
numericList($data, true);
```

License
=======

[](#license)

This plugin is provided freely under the [MIT license](LICENSE.md) by [hana+nils · Büro für Gestaltung](https://hananils.de). We create visual designs for digital and analog media.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance65

Regular maintenance activity

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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

Every ~365 days

Recently: every ~329 days

Total

6

Last Release

318d ago

Major Versions

1.0.0 → 2.0.02021-11-17

2.2.0 → 3.0.02025-06-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0465cfa7ef2b9a264429068ddfeb765f3881f9c611048d2e7e95dfad4afbb35?d=identicon)[hananils](/maintainers/hananils)

---

Top Contributors

[![nilshoerrmann](https://avatars.githubusercontent.com/u/25466?v=4)](https://github.com/nilshoerrmann "nilshoerrmann (19 commits)")

---

Tags

kirby3-plugin

###  Code Quality

Static AnalysisRector

### Embed Badge

![Health badge](/badges/hananils-kirby-link-methods/health.svg)

```
[![Health](https://phpackages.com/badges/hananils-kirby-link-methods/health.svg)](https://phpackages.com/packages/hananils-kirby-link-methods)
```

###  Alternatives

[aaronfrancis/flaky

A Laravel package to elegantly handle flaky operations.

41524.8k](/packages/aaronfrancis-flaky)[cedaro/woocommerce-coupon-links

A WordPress plugin to automatically apply a WooCommerce coupon code to the cart with a URL.

13770.4k](/packages/cedaro-woocommerce-coupon-links)[execut/yii2-widget-bootstraptreeview

Bootstrap Tree View widget wrapper for yii2

46170.2k](/packages/execut-yii2-widget-bootstraptreeview)[mouf/classname-mapper

Provides a way to find in which PHP files a class will be looked upon.

112.3M5](/packages/mouf-classname-mapper)[tarfin-labs/zbar-php

zbar-php is a php package that provides an interface to the zbar bar-code reading library.

2593.2k](/packages/tarfin-labs-zbar-php)[fkr/simplepie-bundle

Integrates SimplePie into Symfony

11137.5k](/packages/fkr-simplepie-bundle)

PHPackages © 2026

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