2017 © Pedro Peláez
 

contao-module contao-nested-menu

Nested menus for Contao OpenSource CMS

image

bit3/contao-nested-menu

Nested menus for Contao OpenSource CMS

  • Saturday, December 21, 2013
  • by tril
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1,996 Installations
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

Nested menus for the Contao OpenSource CMS

Build Status, (*1)

The benefit of nested menu is to reduce the count of backend menu items and group them into a sub menu., (*2)

Define nested menu items

First you need a navigation setup with a lot of items., (*3)

$GLOBALS['BE_MOD']['my'] = array(
    'entry1' => array(
        'tables' => array('table1'),
    ),
    'entry2' => array(
        'tables' => array('table2'),
    ),
    'entry3' => array(
        'tables' => array('table3'),
    ),
    'entry4' => array(
        'tables' => array('table4'),
    ),
    'entry5' => array(
        'tables' => array('table5'),
    ),
    'entry6' => array(
        'tables' => array('table6'),
    ),
    'entry7' => array(
        'tables' => array('table7'),
    ),
    'entry8' => array(
        'tables' => array('table8'),
    ),
    'entry9' => array(
        'tables' => array('table9'),
    ),
);

Now you have to define, which item will be nested into another item., (*4)

$GLOBALS['BE_MOD']['my'] = array(
    'entry1' => array(
        'tables' => array('table1'),
    ),
    'entry2' => array(
        'tables' => array('table2'),
    ),
    'entry3' => array(
        'tables' => array('table3'),
    ),
    'entry4' => array(
        'tables' => array('table4'),
    ),
    'entry5' => array(
        'nested' => 'grouped_entries',
        'tables' => array('table5'),
    ),
    'entry6' => array(
        'nested' => 'grouped_entries',
        'tables' => array('table6'),
    ),
    'entry7' => array(
        'nested' => 'grouped_entries',
        'tables' => array('table7'),
    ),
    'entry8' => array(
        'nested' => 'grouped_entries',
        'tables' => array('table8'),
    ),
    'entry9' => array(
        'nested' => 'grouped_entries',
        'tables' => array('table9'),
    ),
);

Now a virtual structure will be created, that look like this:, (*5)

$GLOBALS['BE_MOD']['my'] = array(
    'entry1' => array(
        'tables' => array('table1'),
    ),
    'entry2' => array(
        'tables' => array('table2'),
    ),
    'entry3' => array(
        'tables' => array('table3'),
    ),
    'entry4' => array(
        'tables' => array('table4'),
    ),
    'grouped_entries' => array(
        'callback' => 'NestedMenuController',
    ),
);

Keep in mind, the entries entry5 till entry9 are only hidden from the user., (*6)

The new item grouped_entries now provide a navigation listing, similar to the old navigation listing, known from the Contao 2 backend startpage., (*7)

It is also possible to make different groups in the sub menu, just add a :group-name to the nested key., (*8)

$GLOBALS['BE_MOD']['my'] = array(
    'entry1' => array(
        'tables' => array('table1'),
    ),
    'entry2' => array(
        'tables' => array('table2'),
    ),
    'entry3' => array(
        'tables' => array('table3'),
    ),
    'entry4' => array(
        'tables' => array('table4'),
    ),
    'entry5' => array(
        'nested' => 'grouped_entries:group1',
        'tables' => array('table5'),
    ),
    'entry6' => array(
        'nested' => 'grouped_entries:group1',
        'tables' => array('table6'),
    ),
    'entry7' => array(
        'nested' => 'grouped_entries:group2',
        'tables' => array('table7'),
    ),
    'entry8' => array(
        'nested' => 'grouped_entries:group2',
        'tables' => array('table8'),
    ),
    'entry9' => array(
        'nested' => 'grouped_entries:group3',
        'tables' => array('table9'),
    ),
);

Now entry5 and entry6 will be grouped, entry7 and entry8 will be grouped and also entry9 get an own group., (*9)

Translations

Every sub menu group require a language key in the $GLOBALS['TL_LANG']['MOD'] array, equals to the group name., (*10)

$GLOBALS['TL_LANG']['MOD']['grouped_entries:group1'] = 'Group 1';
$GLOBALS['TL_LANG']['MOD']['grouped_entries:group2'] = 'Group 2';
$GLOBALS['TL_LANG']['MOD']['grouped_entries:group3'] = 'Group 3';

Security

Because nested menu is just a visual modification, you can grant or limit access to every single menu item, including the grouped item itself. You will not miss all any permissions Contao provide., (*11)

The Versions

21/12 2013

dev-master

9999999-dev http://bit3.de

Nested menus for Contao OpenSource CMS

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

menu contao

21/12 2013
21/12 2013
12/11 2013
02/09 2013
17/05 2013

1.0.3

1.0.3.0 http://bit3.de

Nested menus for Contao OpenSource CMS

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

menu contao

14/05 2013

1.0.2

1.0.2.0 http://bit3.de

Nested menus for Contao OpenSource CMS

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

menu contao

21/04 2013

1.0.1.2

1.0.1.2 http://bit3.de

Nested menus for Contao OpenSource CMS

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

menu contao

21/04 2013

1.0.1.1

1.0.1.1 http://bit3.de

Nested menus for Contao OpenSource CMS

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

menu contao

21/04 2013

1.0.0.1

1.0.0.1 http://bit3.de

Nested menus for Contao OpenSource CMS

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3
  • contao 2.11.*

 

The Development Requires

menu contao

21/04 2013

1.0.1

1.0.1.0 http://bit3.de

Nested menus for Contao OpenSource CMS

  Sources   Download

LGPL-3.0+

The Requires

 

The Development Requires

menu contao

19/02 2013

1.0.0

1.0.0.0 http://bit3.de

Nested menus for Contao OpenSource CMS

  Sources   Download

LGPL-3.0+

The Requires

  • php >=5.3

 

The Development Requires

menu contao