tyrannosaurusjames / silverstripe-menumanager-subsites

A module for SilverStripe that makes the heyday/silverstripe-menumanager module compatible with the silverstripe/subsites module
MIT License
2 stars 8 forks source link

SilverStripe menu manager subsites integration

This module enables per subsite menu sets using Heyday's Menu Manager module.

Installation

Install via composer:

composer require guttmann/silverstripe-menumanager-subsites dev-master

No other configuration is required. Once installed any menu sets created will be linked to the currently selected Subsite at the time of creation.

Usage

Menu sets can still be accessed from templates via $MenuSet("Your Menu Set").MenuItems but if you want to ensure each Subsite only accesses its own MenuSets you can use this in your templates instead:

<% loop $SubsiteMenuSet("Your Menu Set").MenuItems %>
    <a href="https://github.com/tyrannosaurusjames/silverstripe-menumanager-subsites/blob/master/$Link" class="$LinkingMode">$MenuTitle</a>
<% end_loop %>