https://github.com/arillo/silverstripe-elements-menu
https://github.com/arillo/silverstripe-elements-menu
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/arillo/silverstripe-elements-menu
- Owner: arillo
- License: mit
- Created: 2017-02-23T15:44:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-09-15T15:34:35.000Z (10 months ago)
- Last Synced: 2025-09-15T17:37:49.548Z (10 months ago)
- Language: PHP
- Size: 16.6 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: License.md
Awesome Lists containing this project
README
# Arillo\Elements\Menu
[](https://packagist.org/packages/arillo/silverstripe-elements-menu)
[](https://packagist.org/packages/arillo/silverstripe-elements-menu)
Adds inpage menus for Arillo\Elements.
### Requirements
SilverStripe CMS ^4.0
arillo/silverstripe-elements >=2.0.5
## Installation
Install with composer:
```bash
composer require arillo/silverstripe-elements-menu
```
## Usage
### PHP
`Arillo\Elements\Menu\ElementBaseExtension` is already added to `Arillo\Elements\ElementBase` when this package is installed. You need to use `Arillo\Elements\Menu\ElementsMenu` in your `Page.php` e.g.:
```php
';
// can be used to deactivate inpage-menus for certain SiteTree subclasses.
private static $disable_elements_menu = true;
// add this
use ElementsMenu;
}
```
### Templates
You can use `ElementsMenu.ss` provided by this module:
```
<% include ElementsMenu %>
```
or you might to provide your own markup e.g.:
```
<% if $ElementsMenuItems.Exists %>
-
<% if $MenuTitle %>$MenuTitle<% else %>$Title<% end_if %>
<% loop $ElementsMenuItems %>
<% end_loop %>
<% end_if %>
```