Download the PHP package shallowred/kirby-navigation-menus without Composer
On this page you can find all versions of the php package shallowred/kirby-navigation-menus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shallowred/kirby-navigation-menus
More information about shallowred/kirby-navigation-menus
Files in shallowred/kirby-navigation-menus
Package kirby-navigation-menus
Short Description A powerful and flexible navigation menu system for Kirby CMS with advanced features like dropdowns, mobile toggles, breadcrumbs, and comprehensive accessibility support.
License MIT
Homepage https://github.com/ShallowRed/kirby-navigation-menus
Informations about the package kirby-navigation-menus
Kirby Navigation Menus Plugin
A powerful and flexible navigation menu system for Kirby CMS that provides reusable navigation components with advanced features like dropdowns, mobile toggles, breadcrumbs, and comprehensive accessibility support.
Features
- 🎯 Reusable Navigation Menus: Define navigation menus once, use them anywhere
- 📱 Mobile-First Design: Built-in mobile navigation with toggles
- ♿ Accessibility Ready: ARIA attributes, keyboard navigation, screen reader support
- 🎨 Highly Configurable: Extensive configuration options for styling and behavior
- 🌍 Multilingual Support: Full internationalization with English and French translations
- 🔒 Security Built-in: XSS protection, URL validation, external link handling
- 🎛️ Block-Based: Works seamlessly with Kirby's block editor
- 🔗 Multiple Link Types: Simple links, buttons, and dropdown menus
Installation
Via Composer (Recommended)
Manual Installation
- Download and extract the plugin
- Copy to
/site/plugins/kirby-navigation-menus - Install the required dependency:
lukaskleinschmidt/kirby-snippet-controller
Dependencies
This plugin requires:
getkirby/composer-installer: ^1.1lukaskleinschmidt/kirby-snippet-controller: ^2.2
Quick Start
1. Configure Your Menus
Add your navigation menus to your site configuration:
2. Add Navigation Fields to Your Blueprints
3. Use in Your Templates
Configuration Options
Default Behavior
CSS & Styling
Security Settings
Mobile & Accessibility
Navigation Item Types
Simple Links
Buttons
Dropdown Menus
Site Methods
site()->getMenu($key)
Retrieves a navigation menu by its key.
site()->navPages($key)
Gets navigation pages as a blocks collection.
site()->renderNavItem($navPage, $currentPage)
Renders a single navigation item with proper current page detection.
site()->isValidUrl($url)
Validates URLs according to security configuration.
Page Methods
$page->isInMenu($key)
Check if the current page is in a specific navigation menu.
$page->prevInMenu($key) / $page->nextInMenu($key)
Navigate to the previous/next page in a navigation menu.
$page->hasPrevInMenu($key) / $page->hasNextInMenu($key)
Check if previous/next pages exist in navigation.
Advanced Usage
Custom Navigation Rendering
Breadcrumb Navigation
Mobile Navigation with JavaScript
Styling Examples
Basic CSS
Troubleshooting
Common Issues
- Navigation not appearing: Check that your menu is properly configured in
site/config/config.php - Current page not detected: Ensure
auto-current-detectionis enabled - Mobile toggle not working: Add JavaScript for mobile toggle functionality
- Dropdown menus not styling: Check your CSS for
.dropdownclasses
Debug Mode
Enable debug mode to see helpful warnings:
Performance Tips
- Use
site()->getMenu()for simple content access - Use
site()->navPages()when you need to iterate over items - Cache navigation rendering in production if needed
- Limit dropdown depth to 2 levels for better UX
Security Considerations
- All user input is sanitized automatically
- URLs are validated against allowed schemes
- External links get
rel="noopener noreferrer"automatically - XSS protection built-in
Multilingual Support
The plugin includes translations for English and French. Add your own translations:
License
MIT License. See LICENSE.md for details.
Contributing
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure PSR coding standards compliance
- Submit a pull request
Support
- Documentation
- Issues
- Kirby Community Forum
Development
Add instructions on how to help working on the plugin (e.g. npm setup, Composer dev dependencies, etc.)
License
MIT