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

https://github.com/arillo/silverstripe-elements-menu


https://github.com/arillo/silverstripe-elements-menu

Last synced: 9 months ago
JSON representation

Awesome Lists containing this project

README

          

# Arillo\Elements\Menu

[![Latest Stable Version](https://poser.pugx.org/arillo/silverstripe-elements-menu/v/stable?format=flat)](https://packagist.org/packages/arillo/silverstripe-elements-menu)
 
[![Total Downloads](https://poser.pugx.org/arillo/silverstripe-elements-menu/downloads?format=flat)](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 %>


<% end_if %>
```