oblik/kirby-entity-field

This package is abandoned and no longer maintained. No replacement package was suggested.

Kirby field that acts as a one-entry structure.

Maintainers

Package info

github.com/OblikStudio/kirby-entity-field

Language:Vue

Type:kirby-plugin

pkg:composer/oblik/kirby-entity-field

Statistics

Installs: 4 670

Dependents: 0

Suggesters: 0

Stars: 50

Open Issues: 0

2.0.1 2023-01-11 05:32 UTC

This package is auto-updated.

Last update: 2024-03-04 08:19:08 UTC


README

DEPRECATED! Since Kirby 4, there's the new built-in object field. It works in exactly the same way. You should use it instead.

Kirby Entity Field

Kirby field that allows you to add other fields to it with the intention of scoping them. It works like a Structure with one entry but with much cleaner UI.

panel screenshot

Installation

From oblik/kirby-entity-field on Packagist using Composer:

composer require oblik/kirby-entity-field

Usage

In the blueprint:

fields:
  header:
    type: entity
    icon: title # optional
    toggle: true # optional
    fields:
      title:
        type: text
      logo:
        type: files

In the template, use the toEntity() method:

$header = $page->header()->toEntity();
echo $header->title();

Toggle

When the toggle option is enabled, the field form can be collapsed. The state is persisted in localStorage for when the user navigates away from the page and back.

To enable this option globally for all fields (instead of explicitly setting it in the blueprint for each field), add the following to your site/config/config.php:

return [
    'oblik.entity-field' => [
        'toggle' => true
    ]
];