I had an idea a while back for a web application I wanted to create. I’d not worked much with Bootstrap (http://getbootstrap.com/) and wanted to have some experience with it, so I thought I’d play around with building the app I wanted using the framework.
The Bootstrap web site is pretty detailed, and I quickly found an application template I could use for my application. As I poked around, I noticed that the template allowed me to add a simple menu to my application and that worked for me. As I played around with it, I found that every single example I could find ANYWHERE for how to use the Bootstrap navbar (the menu) only showed how to create the menu, not anything about how to structure a the page sections within the application that would appear as you selected each menu item. I checked all of the Bootstrap web site, stack overflow and any other site I could find with examples, but there were none that showed a complete example of a complete Bootstrap web application that had a menu.
Anyway, I found a post on Stack Overflow that showed the JavaScript code needed to process the menu and customized it to suit my needs. The example I found at http://stackoverflow.com/questions/19579083/bootstrap-how-to-use-navbar showed how to deal with a simple menu, but what I implemented, based on the template I was using, had two menus, so I had to make minor adjustments. I also found another Stack Overflow post that described how to set the active menu item in a Bootstrap application at http://stackoverflow.com/questions/11813498/make-twitter-bootstrap-navbar-link-active. With these two posts, I was able to cobble together what I needed. This repository contains the complete source code for the project
You can find a post I wrote describing this code on www.johnwargo.com.
You can find information on many different topics on my personal blog. Learn about all of my publications at John Wargo Books.
If you find this code useful and feel like thanking me for providing it, please consider Buying Me a Coffee, or making a purchase from my Amazon Wish List.