www.webdeveloper.com
Results 1 to 9 of 9

Thread: Beginner questions about Navigation Bars.

  1. #1
    Join Date
    Apr 2014
    Posts
    14

    Beginner questions about Navigation Bars.

    Hey, I'm pretty new to the web-development scene, in fact I've only been doing it for about three days now, but out of those three days, probably 50 man-hours have been put into writing and experimenting.

    My problem is that when I want to update a link, or text on my navigation bar I have to go into each page on my website and update it manually.

    Is there a way to only write the NavBar once, and perhaps pull that file into the website?

    For instance, Index.html pulls Navbar.html into the "navbar" div?

    Hopefully that was understandable.

  2. #2
    Join Date
    Mar 2011
    Posts
    1,136
    Yes, there are several ways to do that. Search on "single file navigation" and you'll find some good advice.
    Rick Trethewey
    Rainbo Design

  3. #3
    Join Date
    Mar 2012
    Posts
    1,243
    Just to elaborate on Rick's reply, the best way to do this is by using PHP include files. This applies not only to nav bars, but also to headers, footers or any other content that is not unique to a page. PHP include files are very easy to write and use, but first you need to set up a local host to use for development purposes. I use Wampserver, it's free and installs automatically. It is well worth the effort to set up and learn a little PHP. Oh, and your web host needs to support PHP. Pretty well all paid hosts do, but not all free ones.

  4. #4
    Join Date
    Apr 2014
    Posts
    14
    Quote Originally Posted by jedaisoul View Post
    Just to elaborate on Rick's reply, the best way to do this is by using PHP include files. This applies not only to nav bars, but also to headers, footers or any other content that is not unique to a page. PHP include files are very easy to write and use, but first you need to set up a local host to use for development purposes. I use Wampserver, it's free and installs automatically. It is well worth the effort to set up and learn a little PHP. Oh, and your web host needs to support PHP. Pretty well all paid hosts do, but not all free ones.
    Thanks, because of the help I've recieved here (Mainly knowing what to search for) I've been able to change my code on each page from around 200 lines, to about 20.

    It's beautiful, and only having to update my header/footer/nav once is amazing.

  5. #5
    Join Date
    Oct 2013
    Location
    3rd planet from the sun
    Posts
    163
    If you are using a code editor for example; DreamWeaver just use Find and Replace.

  6. #6
    Join Date
    Mar 2014
    Location
    United Kingdom
    Posts
    69
    Yes you can do it with dreamweaver just press ctrl + f and replace with an old content

  7. #7
    Join Date
    Apr 2014
    Location
    India
    Posts
    3
    If you are using dream weaver, In css tab, in that you can change the text of navigation bar for all pages at one place.

  8. #8
    Join Date
    May 2014
    Posts
    1
    Go to link for nevigation bars :
    Last edited by jedaisoul; 05-03-2014 at 02:57 AM. Reason: dead link removed

  9. #9
    Join Date
    Mar 2014
    Location
    UAE
    Posts
    99
    Copy paste it on same but the condition is the template is same.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles