2017 © Pedro Peláez
 

silverstripe-module grouped-cms-menu

Allows you to group CMS menu items.

image

silverstripe-australia/grouped-cms-menu

Allows you to group CMS menu items.

  • Thursday, June 29, 2017
  • by ssau
  • Repository
  • 11 Watchers
  • 29 Stars
  • 41,138 Installations
  • PHP
  • 6 Dependents
  • 1 Suggesters
  • 13 Forks
  • 6 Open issues
  • 15 Versions
  • 3 % Grown

The README.md

SilverStripe Grouped CMS Menu

This module allows you to group CMS menu items into nested lists which expand when hovered over. This is useful when there are so many CMS menu items that screen space becomes an issue., (*1)

Previous versions are available through the appropriate branch., (*2)

Basic Usage

In order to group CMS menu items together, define your menu groups in a config.yml file., (*3)

In the example below, CMSMain (Pages) and AssetAdmin (Files & Images) are grouped together under a "Content" heading., (*4)

SilverStripe\Admin\LeftAndMain:
  menu_groups:
    Content:
      children:
        - SilverStripe-CMS-Controllers-CMSPagesController
        - SilverStripe-AssetAdmin-Controller-AssetAdmin

Sort order

The items in each grouped menu will follow the order you set in your YML. The groups themselves will be inserted in the menu with a priority of 0, with other menu items appearing above or below depending on their existing priority. You can change the priority of a menu group like this:, (*5)

SilverStripe\Admin\LeftAndMain:
  menu_groups:
    Other:
      priority: -500
      children:
        - SilverStripe-Reports-ReportAdmin
        - SilverStripe-Admin-SecurityAdmin

Or you can "group" items by themselves to make any menu item follow the order you set in your configuration:, (*6)

SilverStripe\Admin\LeftAndMain:
  menu_groups:
    SilverStripe\CMS\Controllers\CMSPagesController:
      children:
        - SilverStripe-CMS-Controllers-CMSPagesController
    Other:
      children:
        - SilverStripe-Reports-ReportAdmin
        - SilverStripe-Admin-SecurityAdmin

When you have larger menus, and/or multiple modules combining to the same menu, this may require something more consistent. In which case, you may sort your grouped menus alphabetically., (*7)

SilverStripe\Admin\LeftAndMain:
  menu_groups:
    SilverStripe\CMS\Controllers\CMSPagesController:
      children:
        - SilverStripe-CMS-Controllers-CMSPagesController
    Other:
      children:
        - SilverStripe-Reports-ReportAdmin
        - SilverStripe-Admin-SecurityAdmin
  menu_groups_alphabetical_sorting: true

Group icons

You can add a CSS class to groups for the purpose of adding an icon. The class name will be prefixed with 'font-icon-'. In the example below the same icon used for the Pages menu item will be used for the Content group:, (*8)

SilverStripe\Admin\LeftAndMain:
  menu_groups:
    Content:
      icon: 'sitemap'
      children:
        - SilverStripe-CMS-Controllers-CMSPagesController
        - SilverStripe-AssetAdmin-Controller-AssetAdmin;

Translating group labels

A group label may be translated by providing a translation key as below (using the 'Other' group from above as an example), (*9)

langcode:
  GroupedCmsMenuLabel:
    Other: 'translated text'

If the group label has spaces, these will be converted to underscores for the key, (*10)

langcode:
  GroupedCmsMenuLabel:
    Other_Label: 'translated text'

Requirements

  • SilverStripe 4+ and 5+ (See other branches for compatibility with older versions)

Credits

  • A massive thanks to Russ Michell (phptek) for upgrading this module to be SS4 compatible!

The Versions

29/06 2017

dev-master

9999999-dev https://github.com/symbiote/silverstripe-grouped-cms-menu

Allows you to group CMS menu items.

  Sources   Download

BSD-3-Clause

The Requires

 

module cms silverstripe menu

29/06 2017

3.0.1

3.0.1.0 https://github.com/symbiote/silverstripe-grouped-cms-menu

Allows you to group CMS menu items.

  Sources   Download

BSD-3-Clause

The Requires

 

module cms silverstripe menu

23/06 2017

3.0.0

3.0.0.0 https://github.com/symbiote/silverstripe-grouped-cms-menu

Allows you to group CMS menu items.

  Sources   Download

BSD-3-Clause

The Requires

 

module cms silverstripe menu

11/01 2017

2.5.0

2.5.0.0 https://github.com/silverstripe-australia/silverstripe-grouped-cms-menu

Allows you to group CMS menu items.

  Sources   Download

BSD-3-Clause

The Requires

 

module cms silverstripe menu

09/03 2016

2.4.0

2.4.0.0 https://github.com/silverstripe-australia/silverstripe-grouped-cms-menu

Allows you to group CMS menu items.

  Sources   Download

BSD-3-Clause

The Requires

 

module cms silverstripe menu

09/03 2016

2.3.x-dev

2.3.9999999.9999999-dev https://github.com/silverstripe-australia/silverstripe-grouped-cms-menu

Allows you to group CMS menu items.

  Sources   Download

BSD-3-Clause

The Requires

 

module cms silverstripe menu

09/03 2016

2.3.0

2.3.0.0 https://github.com/silverstripe-australia/silverstripe-grouped-cms-menu

Allows you to group CMS menu items.

  Sources   Download

BSD-3-Clause

The Requires

 

module cms silverstripe menu

04/11 2015

2.2.3

2.2.3.0 https://github.com/silverstripe-australia/silverstripe-grouped-cms-menu

Allows you to group CMS menu items.

  Sources   Download

BSD-3-Clause

The Requires

 

module cms silverstripe menu

25/08 2015

2.2.2

2.2.2.0 https://github.com/silverstripe-australia/silverstripe-grouped-cms-menu

Allows you to group CMS menu items.

  Sources   Download

BSD-3-Clause

The Requires

 

module cms silverstripe menu

06/08 2015

2.2.1

2.2.1.0 https://github.com/silverstripe-australia/silverstripe-grouped-cms-menu

Allows you to group CMS menu items.

  Sources   Download

BSD-3-Clause

The Requires

 

module cms silverstripe menu

04/12 2014

2.1.x-dev

2.1.9999999.9999999-dev https://github.com/silverstripe-australia/silverstripe-grouped-cms-menu

Allows you to group CMS menu items.

  Sources   Download

BSD-3-Clause

The Requires

 

module cms silverstripe menu

04/12 2014

2.1.1

2.1.1.0 https://github.com/silverstripe-australia/silverstripe-grouped-cms-menu

Allows you to group CMS menu items.

  Sources   Download

BSD-3-Clause

The Requires

 

module cms silverstripe menu

04/12 2014

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/silverstripe-australia/silverstripe-groupedcmsmenu

Allows you to group CMS menu items.

  Sources   Download

BSD-3-Clause

The Requires

 

module cms silverstripe menu

04/12 2014

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/silverstripe-australia/silverstripe-groupedcmsmenu

Allows you to group CMS menu items.

  Sources   Download

BSD-3-Clause

The Requires

 

module cms silverstripe menu

03/12 2014

2.1.0

2.1.0.0 https://github.com/silverstripe-australia/silverstripe-groupedcmsmenu

Allows you to group CMS menu items.

  Sources   Download

BSD-3-Clause

The Requires

 

module cms silverstripe menu