Kirby TabsField plugin
A tabs field for the panel, to use with $field->when() conditions.
- Remembers the last open tab.
- The field value is never saved in the content file.
- The field value is available for usage with
- Tabs can have labels and icons.
This plugin requires Kirby 3.6 or later.
Download and copy this repository to
git submodule add https://github.com/daandelange/kirby3-tabsfield.git site/plugins/tabsfield
Everything is scriptable trough blueprints.
- Add one or multiple
tabsfields to your fields sections, providing each of them with some
*Note: As any kirby field, every tab field must have a unique key within your blueprint setup.
- Add corresponding
when:conditions to your fields and/or sections.
sections: fields: type: fields sticky: true fields: sidebartab: type: tabs # Tabs must have a name and a both optional label and icon tabs: - name: metainfo icon: tag label: Info - name: files icon: file label: Files categories: type: tags label: Categories # Shows this individual field when the metainfo tab is active when: sidebartab: metainfo author: type: users label: Author min: 1 required: true # Shows this individual field when the metainfo tab is active when: sidebartab: metainfo files: type: files headline: File Manager # Shows this individual field when the files tab is active # (the same can be done with a files section) when: sidebartab: files
Used internally by this plugin to make the field value available for
when conditions without triggering a change notification.
There are no options available yet. Would you like to contribute some ?
In order to re-use the KTabs component, you need to make some symlinks to kirby’s panel src folder in the
src folder :
# First ensure the plugin's path is myWebsite/site/plugins/tabsfield # Ensure kirby's path is myWebsite/kirby # Otherwise change the relative path according to your kirby setup. cd site/plugins/tabsfield ln -s ../../../../kirby/panel/src/ ./src/panel
npm install: Install the required dependencies.
npm run dev: Develop mode (listen/compile).
npm run build: Compile for publishing.
MIT – Free to use, free to improve !
However, for usage in commercial projects, please consider to improve the plugin a little and contribute back the changes with a PR, or hire someone to do so.
In loving memory of the Kirby 2 alternative : Kirby-Tabs-Field by @afbora.
Author: Daan de Lange