This plugin creates a new backend section for Menu Management. This allows for separation of menu management from other site tasks.
Within the admin area, you can add items to a menu. These items link to particular files in your site. The most popular use of this would be to create menus for your site. The ordering of menus is controlled via a drag and drop feature.
Features
- Ability to select parent node when adding a component to a page to control menu display
- Drag and drop re-ordering of menus
- Active states automatically set based on the current page. This can be over-ridden to be any menu
- Controllable depth of output, between 1-3 levels
Icon by VisualPharm
Available Options
- Alias - This is available to all components and is baked into OctoberCMS
- Parent Node - The node to get the children of to create the menu. See the Parent Node section below for further information
- Active Node - This is the active page. The default option is the current page, but you can manually set which menu item should be active.
- Primary Classes - The classes to add to the parent ul tag. Defaults to "nav nav-pill"
- Secondary Classes - The classes to add to the children ul tag. Defaults to "dropdown-menu"
- Tertiary Classes - The classes to add to the grandchildren ul tag. Defaults to ""
- Depth - How many levels of menu to display. The bootstrap default is 2, so if you do wish to show 3 levels please bear in mind you will need to add your own css to the theme to handle active states.
Adding the component to a Page
When editing a page/partial/layout, add the component to the page as you would any other component
{% component "menu" %}
Inside the widget, you can set the menu class for both the primary and secondary navigation. You also set the parent node at this time.
Behind the scenes
Menu Manager takes advantage of Nested Sets to allow quick traversal and drag and drop functionality. It also makes working out the active page and active parents super simple.
By default no items are created. If you are developing, simply add the seed file back into the update file and run a php artisan plugin:refresh
on the server to have some date pre-inserted.
The Parent Node
This is the node from which the menu will be populated. The component will collect all the children of this node and create the menu content from these children nodes. For example, consider this default structure based loosely off the October CMS demo pages.
- Main Menu -- Home --- Plugin Components --- Ajax Framework
If we select "Main Menu" as the Parent Node, we will have 1 menu item visible. This will the title of "Home" and will be a bootstrap style dropdown navigation. Clicking on home will reveal 2 sub-menu items, "Plugin Components" and "Ajax Framework".
If we select "Home" as the Parent Node, we will have 2 menu items visible, "Plugin Components" and "Ajax Framework".
This allows the creation of side navigation relevant to the page you are currently on by re-using the same backend menu but having separate components on the page use different Parent Nodes to change the output.
Other
If you have any suggestions, please raise an issue on the plugin's github repository.
Thanks / Contributions
- Obviously the OctoberCMS creators, Samuel Georges and Aleksey Bobkov
- DanielHitchen for bug reporting, enhancements and requests/ideas
- Adis for help with the 1.1.x releases.
-
Florian Kögler
Found the plugin useful on 17 Mar, 2022
Hi Ben, Unfortunately, after updating OctoberCms to version 2.2.11, all the menu buttons have disappeared from the website. should we wait for a new update from you or is it a dead project since the last update was for June 14, 2018. Thanks,
-
Ben Freke author
Replied on 18 Mar, 2022
Hi Florian
I don't maintain this plugin anymore sorry.
I'm happy to accept Pull Requests, but I haven't actively used OctoberCMS is several years now.
Ben
-
Sergey Alekseev
Found the plugin useful on 31 Jan, 2020
Please, change method onRender() to onRun() in Component to add ability use menu in partials
-
Wapaca
Found the plugin useful on 14 Aug, 2019
Works perfectly but how to override the default.htm into the component folder ? I had to edit it to make a bootstrap 4 navbar.
PS : For those telling this plugin is not working don't forget to drag&drop the menu component into your header partial.
-
Ben Freke author
Replied on 14 Aug, 2019
Hi
I don't think that's possible. I wrote this nearly 5 years ago, and while version 2 would have had this functionality I've never gotten around to finding the time. So I think editing the core code like you did is the best option for now sorry
Ben
-
Doug Gough
Found the plugin not useful on 19 Nov, 2018
I couldn't get it to work, and then I found another plugin that provides pages and menus, so I'm using that instead.
-
Neo Nguyen
Found the plugin not useful on 25 Apr, 2018
No, it does not work for a custom theme?
-
Ben Freke author
Replied on 25 Apr, 2018
There is no reason why it wouldn't. It defaults to using Bootstrap 3. If the custom theme uses something else then you will need to make changes.
Please raise an issue in the forum and I'll investigate further.
-
MIchael Brown
Found the plugin useful on 21 Jul, 2017
A time saver for sure. Thank you for the quality work.
-
Tran Dang Khoa
Found the plugin useful on 30 May, 2017
Sorry about missing the last constraint: 'your PHP version (5.5.9) does not satisfy that requirement'. Actually, I tried to run composer update to check but I didn't know that the package compiler run in a different way.
A strange thing is: when I check other popular plugins, eg: Rainlab Builder, I still see they're using PHP 5.5.9 in their composer.json (ex: https://github.com/rainlab/builder-plugin/blob/master/composer.json)
Right now, I am trying to put the "php": ">=5.6" in my composer.json. After running the composer, I see the final PHP platform version is updated in composer.lock.
I hope this helps to fix the problem.
Thanks and best regards,
-
Codemium
Found the plugin useful on 11 Jul, 2016
The plugin crashed the new october. Plz change in the controller yaml files: @/plugins/benfeke... to $/benfeke...
;) thanks
-
Hakim
Found the plugin useful on 21 May, 2016
works great !
-
Jonathan Irwin
Found the plugin useful on 15 Feb, 2016
Very nice plugin. Super simple and just works.
-
Adam Waring
Found the plugin useful on 15 Jul, 2015
Good all around plugin but needs to be altered so separate parameters will show as separate menu items, else why have the parameters option?
-
Jeff Shinn
Found the plugin useful on 28 Apr, 2015
It looks like if you click on the "Public repository" link you will see a more updated version on GitHub. Looks like updates have been issued up to about a month ago, mainly thanks to Matiss Janis Aboltins.
In either case, this is an excellent and obviously needed plugin for October.
-
Matiss Janis Aboltins
Found the plugin not useful on 4 Mar, 2015
Even though this plugin has over 600 installations - it broken and no longer maintained. It has 3 valid pull requests, but none of them have any reply (or accept/deny) from the author. Last change done to this plugin was in October of 2014.
-
Luuk Lamers
Found the plugin useful on 23 Feb, 2015
Is there a way to use the 'parameters' in item's classes?
-
farhan ahmad
Found the plugin useful on 28 May, 2014
how to activate this plugin?? there is only one component which is todo , how to create this plugin ,
-
Daniel81
Found the plugin useful on 27 May, 2014
Thanks for adding the "active" class to the plugin. Slight issue, if you have a link to home page or
/
the link doesn't get the active class. -
Daniel81
Found the plugin useful on 27 May, 2014
Great menu plugin :) The only thing I would add would be a
current
oractive
class to an item if it's the current page. -
Dmitriy Pavlov
Found the plugin useful on 27 May, 2014
Thank you! Very comfortable plugin!
-
1.5.3 |
Added ability to delete menus. Thanks @osmanzeki Jun 14, 2018 |
---|---|
1.5.2 |
Added French translation. Thanks @Glitchbone Oct 22, 2017 |
1.5.1 |
Added homepage to plugin information. Thanks @gergo85 May 14, 2017 |
1.5.0 |
Fixed bugs preventing postgres and sqlite support May 01, 2017 |
1.4.8 |
Merged PR to fix re-order errors. Thanks @CptMeatball Dec 22, 2016 |
1.4.7 |
Merged PR to fix syntax errors with fresh install of 1.4.6. Thanks @devlifeX Oct 25, 2016 |
1.4.6 |
Merged PRs that fix bug with plugin not working with stable release Oct 22, 2016 |
1.4.5 |
Fixed bug where getBaseFileName method was moved to a different object Jun 26, 2015 |
1.4.4 |
Fixed bug with incorrect labels. Thanks @ribsousa Jun 26, 2015 |
1.4.3 |
Fixed bug where getBaseFileName method was moved to a different object Jun 10, 2015 |
1.4.2 |
Fixed bug with URLs not saving correctly May 18, 2015 |
1.4.1 |
Fixed bug caused by deleting needed method of Menu class. Thanks @MatissJA Mar 23, 2015 |
1.4.0 |
Fix for POST operations. PR by @matissjanis, TR translations (@mahony0) and permission registration (@nnmer) Mar 20, 2015 |
1.3.4 |
Fix for JSON validation not firing Oct 19, 2014 |
1.3.3 |
Fix for JSON comment having single quotes. Thanks @adisos Oct 08, 2014 |
1.3.2 |
Fix for param check that is breaking active node lookup. Thanks @alxy Sep 28, 2014 |
1.3.1 |
JSON validation of parameters added; Correct active menu now being set based on parameters; PR sent by @whsol, thanks! Sep 07, 2014 |
1.3.0 |
Added translation ability thanks to @alxy Aug 23, 2014 |
1.2.0 |
Fixed validation and fields bug; Added list classes Aug 06, 2014 |
1.1.3 |
Fixed bug that prevented multiple components displaying Jul 21, 2014 |
1.1.2 |
Reformatted code for better maintainability and better practises Jul 10, 2014 |
1.1.1 |
Added ability to enable/disable individual menu links; Added ability for url parameters & query string; Fixed issue of "getLinkHref()" pulling through full page url with parameters rather than the ACTUAL page url Jun 17, 2014 |
1.1.0 |
Added ability to link to external sites. Thanks @adisos Jun 17, 2014 |
1.0.6 |
Removed NestedSetModel, thanks @daftspunk Jun 17, 2014 |
1.0.5 |
Moved link creation code into the model in preperation for external links; Brought list item class creation into the model; Fixed typo with default menu class Jun 14, 2014 |
1.0.4 |
Fixed bug where re-ordering stopped working Jun 13, 2014 |
1.0.3 |
Made it possible for menu items to not link anywhere; Put a check in so the active node must be a child of the parentNode May 28, 2014 |
1.0.2 |
Added active state to menu; Added ability to select active menu item; Added controllable depth to component May 27, 2014 |
1.0.1 |
First version of MenuManager May 24, 2014 |