Results 1 to 3 of 3

Thread: Same navbar on multiple pages.

  1. #1

    Thread Starter
    Join Date
    Jan 2020

    Same navbar on multiple pages.

    I have Index.html , about.html contact.html using bootstrap

    I have created a navbar on Index.html but I want the same navbar on all the pages.

    Do i have to copy the same code on every page or is there any other procedure.

    Please suggest!!

  2. #2
    King of sapila
    Join Date
    Oct 2006

    Re: Same navbar on multiple pages.

    If you where using I would have suggested Master Pages.
    In PHP , have a look here , maybe it can help you do the same:
    And bootstrap:
    Last edited by sapator; Sep 23rd, 2020 at 06:26 AM.
    Slow as hell.

  3. #3
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    South Louisiana

    Re: Same navbar on multiple pages.

    Essentially what you're referring to often called components, partials, or templates depending on your environment.

    A fairly straightforward solution using jQuery would be to define the properties of your navbar and its items in a JSON file. You'd then use AJAX to read the JSON file and convert it to an object. Using the object, you would then build the DOM on the fly using the properties of the object and optionally properties from the current location (like the URL to specify an "active" item).

    Could you elaborate on the technologies that you're using and what it is that you'd expect?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width