Topic: Include bootstrap Nav in every html file

Ollie Vincent pro asked 5 years ago

Hi all, Anyone know of anyway to include my bootstrap nav in all my html pages so I only have to edit one file? I have tried JavaScript includes, but they all seem to prevent the Bootstrap Nav dropdown from working (conflict) so I cannot use that. Iframes/objects could be a way, but they are quite heavy, and not really a viable solution. I have also look at HTML imports, but seeing as some browsers (like firefox) dont support them, I dont really see it as a soltuion. Anyone found a another way, it would really speed up my development. Thanks

Bartłomiej Malanowski staff commented 5 years ago

is the issue still open?

Ollie Vincent pro commented 5 years ago

I figured it out - seems to be a bug - I can't resolve this question... it wont save my selection.

Ollie Vincent pro answered 5 years ago

I am using the Bootstrap Nav and footer. The theory being that once it has been included, it should pick up the styles. Unfortunately the menu just breaks with any external JS on the page. I could build the site in PHP or even inject JS, but that is not really how I want to build my sites. Can you elaborate more?   Thanks

Do you use plain HTML or any framework? If you're using handlebars for node.js you can put your css/js files in separate files and include it. If you're using Laravel you can create layout that would already contain css/js files. Even with the plain PHP you can just put mentioned files to separate file like header.php and include it wherever you need

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • User: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No