philippoehrlein / kirby-navigation-groups
A Kirby Plugin for grouping navigation items
Installs: 113
Dependents: 0
Suggesters: 0
Security: 0
Stars: 18
Watchers: 3
Forks: 0
Open Issues: 1
Language:Vue
Type:kirby-plugin
Requires
- php: >=8.0
- getkirby/composer-installer: ^1.2
Requires (Dev)
- getkirby/cms: ^4.0 || ^5.0
README
A plugin for Kirby CMS that allows you to organize your navigation items into groups.
Features
- Create and manage navigation groups
- Drag & drop interface for organizing pages
- Sync sort order with folder structure
- Multi-language support (EN, DE, FR, ES, IT)
- Customizable group fields
Installation
Download
Download and copy this repository to /site/plugins/kirby-navigation-groups
Composer
composer require philippoehrlein/kirby-navigation-groups
Usage
- In your blueprint, add a field of type
navigationgroups
:
fields: navigation: label: Navigation type: navigationgroups
- Optional: Add custom fields to your groups and filter pages by status:
fields: navigation: label: Navigation type: navigationgroups status: listed fields: description: type: textarea label: Description toggle: label: Toggle group type: toggle text: - "no" - "yes"
Options
The plugin supports the following options:
status
: Filter for page status ('all', 'listed', 'unlisted', 'published', default: 'listed')fields
: Additional fields for groups
Field Methods
The plugin provides the Field Method toGroupItems()
to access the stored navigation items:
<?php $items = $page->navigation()->toGroupItems(); ?> <nav class="navigation"> <ul> <?php foreach ($items as $item): ?> <?php if ($item->type() == 'group'): ?> <li> <h2><?= $item->title() ?></h2> <ul> <?php foreach ($item->pages() as $subPage): ?> <li><a href="<?= $subPage->url() ?>"><?= $subPage->title() ?></a></li> <?php endforeach; ?> </ul> </li> <?php else: ?> <li><a href="<?= $item->url() ?>"><?= $item->title() ?></a></li> <?php endif; ?> <?php endforeach; ?> </ul> </nav>
Development
If you want to contribute to the development of this plugin, follow these steps:
- Clone the repository.
- Install dependencies using Composer.
- Make your changes and test them in your Kirby installation.
License
This plugin is open-source and available under the MIT License.