Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xiaohutai/bolt5-hierarchy
[Bolt 5 Extension] Hierarchical content using `menu.yml` for Bolt CMS
https://github.com/xiaohutai/bolt5-hierarchy
Last synced: 25 days ago
JSON representation
[Bolt 5 Extension] Hierarchical content using `menu.yml` for Bolt CMS
- Host: GitHub
- URL: https://github.com/xiaohutai/bolt5-hierarchy
- Owner: xiaohutai
- License: mit
- Created: 2022-07-06T11:11:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-23T13:01:21.000Z (over 1 year ago)
- Last Synced: 2024-09-14T02:22:38.420Z (about 2 months ago)
- Language: PHP
- Size: 15.6 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hierarchy Extension for Bolt 5
Hierarchical content using `menu.yml` for Bolt 5.## Configuration
* `menu`: List of menus to check for.
## Twig Functions and Filters
Generating nice URLs like `/foo/bar` requires you to use the `hMenu` function and the `hLink` filter.
* `hMenu('main')`: Use this function to get nice URLs in your menus.
* `getParent(record)`
* `getParents(record)`
* `getSiblings(record)`
* `getChildren(record)`
* `record|hLink`: Use this filter on records to get nice URLs.## Routes
Add the following to your `routes.yaml` to allow nice URLs.
```
hierarchicalRoute:
resource: 'TwoKings\Hierarchy\Controller\Controller'
type: annotation
```