Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```