{"action":"created","issue":{"url":"https://api.github.com/repos/phiamo/MopaBootstrapBundle/issues/1164","repository_url":"https://api.github.com/repos/phiamo/MopaBootstrapBundle","labels_url":"https://api.github.com/repos/phiamo/MopaBootstrapBundle/issues/1164/labels{/name}","comments_url":"https://api.github.com/repos/phiamo/MopaBootstrapBundle/issues/1164/comments","events_url":"https://api.github.com/repos/phiamo/MopaBootstrapBundle/issues/1164/events","html_url":"https://github.com/phiamo/MopaBootstrapBundle/issues/1164","id":151049426,"number":1164,"title":"Navbar N-Level Dropdown Menus","user":{"login":"jonny827","id":5332148,"avatar_url":"https://avatars.githubusercontent.com/u/5332148?v=3","gravatar_id":"","url":"https://api.github.com/users/jonny827","html_url":"https://github.com/jonny827","followers_url":"https://api.github.com/users/jonny827/followers","following_url":"https://api.github.com/users/jonny827/following{/other_user}","gists_url":"https://api.github.com/users/jonny827/gists{/gist_id}","starred_url":"https://api.github.com/users/jonny827/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonny827/subscriptions","organizations_url":"https://api.github.com/users/jonny827/orgs","repos_url":"https://api.github.com/users/jonny827/repos","events_url":"https://api.github.com/users/jonny827/events{/privacy}","received_events_url":"https://api.github.com/users/jonny827/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-26T06:12:04Z","updated_at":"2016-05-19T09:08:07Z","closed_at":null,"body":"### **Question**\r\nDoes MopaBootstrapBundle 3.x support N-Level Navbars with KNPMenuBundle out of the box with Bootstrap 3.3.x and (ideally 4.x as well)?\r\n\r\n\r\n### **Background**\r\n\r\n**1.**\r\nI read that boostrap 3.x no longer supports sub-meu. - [here](http://stackoverflow.com/questions/18023493/bootstrap-3-dropdown-sub-menu-missing)\r\n\r\n**Thoughts**\r\nOne solution mentioned mentioned  [here](https://github.com/djokodonev/bootstrap-multilevel-dropdown) does not modify core files, however, solo contributor, last update was over 2 years ago, and Bootstrap 4.x is already on the way.\r\n\r\nA second solutuion was [Smart Menus](https://github.com/vadikom/smartmenus) It does not modify core files, solo contributor with January 27th 2016 as last commit.\r\n\r\nThe other solutions were very one off/hackish(yes, I know we are developers), however, I believe that if we are creating bundles, they might as well be sustainable and use best practices even if that means collaborating where weaknesses or lack of functionality may exist.\r\n\r\n**2.**\r\nA) I read [here](https://github.com/twbs/bootstrap/pull/6342) that bootstrap author Mark Otto sais- \"Submenus just don't have much of a place on the web right now, especially the mobile web. They will be removed with 3.0\" \r\n\r\nB) Acording to @isometriks  (2nd place contributor of MopaBootstrapBundle at time of question) [here](https://github.com/phiamo/MopaBootstrapBundle/issues/902)  \"If you really need more than one nav bar on a page which I don't think is a common use case, you can just copy the contents of that template and just add it yourself. Or create your own template and then embed that. \" \r\n\r\n**Thoughts**\r\n If submenus dont have a place, and if we \"really dont need more than one\" navbar(I presume he is also including subnavigation in this) then are we to use tag clouds or seach or search engines to navigate the content on our websites? \r\n\r\n**3.**\r\nThere are features of SmartMenus that MopaBootstrapBundle does not currently have like @auipga [https://github.com/phiamo/MopaBootstrapBundle/pull/1155](url) has mentioned one.\r\n\r\n**Thoughts**\r\nWhy not allow MopaBootstrapBundle to be the Symfony2/3 Bridge for SmartMenus?  This would allow you to offload Navbar feature expansion to another project and you just provide the bridge as you currently do with Bootstrap.\r\n\r\n### **Problem**\r\n\r\nI am building a site that requires several levels of a menu. For simplicity, think of a CMS or E-Commerce Bundle with several levels of Pages or Product Categories. I tried to just have a number of main Parent(children of the roots) with a single level of dropdowns below it(for each category of features) but then my Navbar becomes two rows of Parent nodes(and more to come as features expand)\r\n\r\nI tried the below code to build the menus. I see the navbar but all I see is the main First Level and when I hover it shows me the Second level but that is it.  When I hover over the Second level it does NOT expose the third level or anything.. \r\n\r\nNote: I tried both methods of developing the menu array.\r\n\r\n1) Approach 1 - MopaBootstrapBundle OOP Style here: (http://bootstrap.mohrenweiserpartner.de/mopa/bootstrap/navbar)\r\n\r\n\r\n2) Approach 2 -  KNPMenuBundle suggests the array format (a least for level two) as exampled here (https://github.com/KnpLabs/KnpMenuBundle/blob/master/Resources/doc/index.rst)\r\n\r\n\r\n\r\n### **Code**\r\n\r\n \t\t$second = $menu->addChild('First', array( 'dropdown' => true, 'caret' => true))->setExtra('weight', 10);\r\n\t\t$third = $second->addChild('Second', array( 'dropdown' => true, 'caret' => true))->setExtra('weight', 10);\r\n\t\t$fourth = $third->addChild('Third', array( 'dropdown' => true, 'caret' => true))->setExtra('weight', 10);\r\n\t\t$fifth = $fourth->addChild('Fourth', array( 'dropdown' => true, 'caret' => true))->setExtra('weight', 10);\r\n\t\t\r\n\t\t$menu->addChild('2First', array( 'dropdown' => true, 'caret' => true))->setExtra('weight', 100);\r\n\t\t$menu['2First']->addChild('Second', array('dropdown' => true, 'caret' => true))->setExtra('weight', 10);\r\n\t\t$menu['2First']['Second']->addChild('Third', array('dropdown' => true, 'caret' => true))->setExtra('weight', 100);\r\n\t\t$menu['2First']['Second']['Third']->addChild('Fourth', array('dropdown' => true, 'caret' => true))->setExtra('weight', 10); \r\n\r\n\r\n### **Bundles/Libraries**\r\n\r\nMopaBootstrapBundle dev-master(04/24/2016)\r\nBoostrap-Saas : dev-master(04/24/2016)\r\n\r\nJQuery: 2.2.3\r\nBootstrap 3.3.6\r\nFont Awesome 4.3.0\r\nMoment 2.13 \r\n\r\n\r\nI understand I am using dev build on the bundles but my hope was that any bugs found since version 3.0.0's release may have been patched since it was almost 6 months ago. Also, I was hoping this issue had come up in the past(does not seem to have from the issues search) and it may have been discussed and or resolved.  I apologize it has and apologize for the length of this issue(possible feature request) however I tried to keep it as concise as possible.\r\n\r\n### **Summary**\r\nIn a maintainable way(part of bundle or active library)  does MopaBootstrapBundle 3.x support N-Level Navbars with KNPMenuBundle out of the box with Bootstrap 3.3.x and (ideally 4.x as well)?\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/phiamo/MopaBootstrapBundle/issues/comments/220268784","html_url":"https://github.com/phiamo/MopaBootstrapBundle/issues/1164#issuecomment-220268784","issue_url":"https://api.github.com/repos/phiamo/MopaBootstrapBundle/issues/1164","id":220268784,"user":{"login":"jonny827","id":5332148,"avatar_url":"https://avatars.githubusercontent.com/u/5332148?v=3","gravatar_id":"","url":"https://api.github.com/users/jonny827","html_url":"https://github.com/jonny827","followers_url":"https://api.github.com/users/jonny827/followers","following_url":"https://api.github.com/users/jonny827/following{/other_user}","gists_url":"https://api.github.com/users/jonny827/gists{/gist_id}","starred_url":"https://api.github.com/users/jonny827/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonny827/subscriptions","organizations_url":"https://api.github.com/users/jonny827/orgs","repos_url":"https://api.github.com/users/jonny827/repos","events_url":"https://api.github.com/users/jonny827/events{/privacy}","received_events_url":"https://api.github.com/users/jonny827/received_events","type":"User","site_admin":false},"created_at":"2016-05-19T09:08:07Z","updated_at":"2016-05-19T09:08:07Z","body":"A) @isometriks Thank you for such a quick reply to my inquiry. Thank you for clarifying your comment.  I agree that adding undue complexity to a template that in 95%+ of use cases is problematic.  \r\n\r\nB) I completely understand that you would want to keep the bundle isolated and on it's own release schedule (presumably aligning somewhat with Bootstrap major versions) and of course following Symfony requirements.  Thankfully, [SmartMenus](https://github.com/vadikom/smartmenus) does not require any markup other than default  Despite there being some documented requirements for data-target=\".navbar-collapse\" which is different than MopaBootStrapBundle Template it still works so there is no need for a custom template.  NOTE: I have NOT tried any of SmartMenus added features so this may change my above statement. \r\n\r\nC) KNPMenu and KNPMenuBundle and any developers utilizing Bootstrap 3.x for menus would also benefit from using [SmartMenus](https://github.com/vadikom/smartmenus) (it acts like a wonderful polyfill for the bootstrap 3.x N-Level Menu Limitation). It works with KNPMenuBundle out of the box as well.\r\n\r\nD) Mopa makes it better by providing active class, carets for parent dropdowns, 3(THREE) ICON Libraries to chose from integrated, and all its other features!\r\n\r\nE) Would it be good to document that you can use SmartMenus as polyfill the Bootstrap 3.x 2 Level Menu limitation for MopaBootstrapBundle Menus (and others like mentioned above)?\r\n\r\nF) Sorry it has taken me a moment to clean up my reply and finish some of my testing and finalization of building.  I also created a larger discussion [@Security Annotation Driven Weighted N-Level Bootstrap Menus #320](https://github.com/KnpLabs/KnpMenuBundle/issues/320) "}}