https://github.com/jongacnik/kirby-fields-block
Kirby block preview plugin to directly render block fields
https://github.com/jongacnik/kirby-fields-block
Last synced: about 1 year ago
JSON representation
Kirby block preview plugin to directly render block fields
- Host: GitHub
- URL: https://github.com/jongacnik/kirby-fields-block
- Owner: jongacnik
- License: mit
- Created: 2021-05-17T02:22:10.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-03-31T18:33:45.000Z (about 3 years ago)
- Last Synced: 2025-03-31T15:20:29.303Z (about 1 year ago)
- Language: JavaScript
- Size: 39.1 KB
- Stars: 109
- Watchers: 4
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Kirby Fields Block
Kirby [block preview](https://getkirby.com/docs/reference/plugins/extensions/blocks) plugin to directly render block fields, allowing for inline editing.

## Usage
### Block definition
When creating a custom block in your blueprints, pass `preview: fields` to utilize this plugin
```yaml
blockname:
name: Block Name
preview: fields # required
wysiwyg: true # recommended
fields:
text:
label: Text
type: text
```
Setting `wysiwyg: true` prevents drawer from automatically opening when creating a new block.
### Disable block title
You can disable the block title bar by passing `label: false`
```yaml
blockname:
name: Block Name
preview: fields
wysiwyg: true
label: false # disables block title bar
fields:
text:
label: Text
type: text
```
Example

### Collapse/Expand block
You can collapse or expand the block preview by clicking on the arrow icon or double clicking the block title bar.
## Notes
- The block `icon` will appear in the title bar.
- Currently does not support blocks with tabs.
## Installation
```
composer require jg/kirby-fields-block
```
Other installation methods
### Download
Download and copy this repository to `/site/plugins/kirby-fields-block`.
### Git submodule
```
git submodule add https://github.com/jongacnik/kirby-fields-block.git site/plugins/kirby-fields-block
```