twokings/hierarchy

Simple hierarchical content for Bolt 5

Installs: 654

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 2

Forks: 1

Open Issues: 0

Type:bolt-extension

v0.4.0 2023-05-23 12:59 UTC

This package is auto-updated.

Last update: 2024-04-23 14:58:16 UTC


README

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