PHPackages                             olach/relationship - 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. olach/relationship

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

olach/relationship
==================

Sortable multiselect field for Kirby 3 CMS

1.0.3(3y ago)24449MITVue

Since Jan 18Pushed 3y ago3 watchersCompare

[ Source](https://github.com/olach/kirby3-relationship)[ Packagist](https://packagist.org/packages/olach/relationship)[ RSS](/packages/olach-relationship/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Kirby 3 Relationship field
==========================

[](#kirby-3-relationship-field)

[![Latest version](https://camo.githubusercontent.com/a507a8e428087ca21a96ba190ba933d9610bf4d746bd09da20d19e2c07b735af/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6f6c6163682f6b69726279332d72656c6174696f6e736869702e7376673f6d61784167653d31383030)](https://github.com/olach/kirby3-relationship/releases/latest) [![License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](http://www.opensource.org/licenses/mit-license.php) [![Required Kirby version](https://camo.githubusercontent.com/3b0896ddaeffc52cfa36bed1399c603c639406df7857598710f3d69ac24ffbe4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4b697262792d332e782d7265642e737667)](https://getkirby.com)

The Relationship field allows you to select and sort multiple items from a list.

The field was originally created for Kirby 2, where a native multiselect field was not available at the time. With Kirby 3, a built in multiselect field was added, and this field was not really needed anymore. But some people liked the different ui this field provided so it was updated to support Kirby 3.

[![relationship-field-demo](https://user-images.githubusercontent.com/1300644/50839882-94294980-1361-11e9-9de9-523d0d71b8d1.gif)](https://user-images.githubusercontent.com/1300644/50839882-94294980-1361-11e9-9de9-523d0d71b8d1.gif)

This plugin is free to use. But if you find it helpful, feel free to [buy me a coffee](https://www.paypal.me/olachristensson/3usd) ☕️ or purchase your Kirby license(s) through [my affiliate link](https://a.paddle.com/v2/click/1129/36143?link=1170).

Requirements
------------

[](#requirements)

Kirby 3

Still using Kirby 2? Please use the [version for Kirby 2](https://github.com/olach/kirby-relationship) of this plugin.

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

[](#installation)

Download and copy this repository to `/site/plugins/relationship`

Alternatively, you can install it with composer: `composer require olach/relationship`

Usage
-----

[](#usage)

Define a list of options in the field settings. Either manually or using the powerful [Query Language](https://getkirby.com/docs/guide/blueprints/query-language).

The data is saved as a comma separated string, which means that this field is interchangeable with the regular [Multiselect](https://getkirby.com/docs/reference/panel/fields/multiselect) field.

### Example with predefined options

[](#example-with-predefined-options)

#### Blueprint

[](#blueprint)

```
countries:
  label: Countries
  type: relationship
  options:
    sweden: Sweden
    norway: Norway
    denmark: Denmark
    finland: Finland
    iceland: Iceland
    germany: Germany
    france: France
    spain: Spain
    portugal: Portugal
```

#### Template

[](#template)

```

```

### Example with related pages

[](#example-with-related-pages)

#### Blueprint

[](#blueprint-1)

```
related:
  label: Related articles
  type: relationship
  options: query
  query: page.siblings
```

#### Template

[](#template-1)

```
Related articles
