Consistent Headers/Footers Throughout Website?

Discussion in 'Web Design and Development' started by Over Achiever, Nov 17, 2006.

  1. Over Achiever macrumors 68000

    Over Achiever

    Joined:
    Jul 22, 2002
    Location:
    Toledo, OH, formerly Twin Cities, MN
    #1
    Is it possible to reference an .html or .css file for the header and footer? I'm looking for a way to make simple sitewide changes without the use of frames. Is that possible? It seems easy, but my searches don't seem to come up with easy solutions. Right now I'm just looking for something that handles the header, navigation, and a footer that floats at the bottom, with other variables such as background color/image, paragraph styles, etc. Something where I can edit the .css file and the changes are sitewide.

    How difficult can this be?
     
  2. LtRammstein macrumors 6502a

    LtRammstein

    Joined:
    Jun 20, 2006
    Location:
    Denver, CO
    #2
    God I love CSS!

    I see where you are coming from, and I had a similar problem. For the headers, and footers of the code, yes. I wouldn't put the .CSS link into the code there because it already has it's predesigned code. I recommend putting the footer and header into a <div> and working from there.

    Then again, I could be talking out of my ass about the header/footer code, but I know I'm not with the <div>.
     
  3. jsm4182 macrumors 6502

    Joined:
    Apr 3, 2006
    Location:
    Beacon, NY
  4. Makosuke macrumors 603

    Joined:
    Aug 15, 2001
    Location:
    The Cool Part of CA, USA
    #4
  5. decksnap macrumors 68040

    decksnap

    Joined:
    Apr 11, 2003
    #5
    PHP include would work. Or if you're using straight html and a program like dreamweaver, you can build your own templates that change site wide when you edit them.
     
  6. nightelf macrumors 6502

    Joined:
    Mar 25, 2003
    #6
    PHP includes are the best option IMHO.

    Just create two files, for example one called header.php and the other footer.php.

    To include them in your pages, use <?php include('header.php'); ?>. Change the extension of your site to .php and you are done.
     
  7. Chacala_Nayarit macrumors 6502

    Chacala_Nayarit

    Joined:
    Oct 6, 2005
    Location:
    Lakewood, Washington
    #7
    CSS does consistent headers and footers: http://rainiersupply.com

    I am currently re-designing, but the headers and footers are the same through out the site.
     
  8. decksnap macrumors 68040

    decksnap

    Joined:
    Apr 11, 2003
    #8
    But all you've really done is use CSS to place an image, which would change sitewide anyway if edited. You still have all your links written out page by page.
     
  9. elppa macrumors 68040

    elppa

    Joined:
    Nov 26, 2003
    #9
    I wouldn't recommend this.

    Mainly because if you decide to change from Dreamweaver, or if a new person takes over the running of the site who does not use Dreamweaver, then the site wide updating goes out the window.
     
  10. clintob macrumors 6502

    clintob

    Joined:
    Feb 16, 2006
    Location:
    New York, NY
    #10
    Dreamweaver is pretty cumbersome when it comes to templates. It can very confusing very fast.

    Do yourself a favor and start using a simpler editor. I personally love TextMate, but also enjoyed using skEdit. There are tons out there, and each one runs circles around Dreamweaver for usability and consistency.

    That said, I agree with the PHP folks here - that's the easiest way to go. But if all you want to do is easily replace the header/footer code on each page as you go, and you're not comfortable with a variety of programming languages, it's really a simple cut and paste job. Use any progam (Dreamweaver being one) where you can search the text of multiple documents at once; search for the block of code for your old header and replace with the new block of code you just wrote. It's ham-handed, but it only takes 2 or 3 minutes to change as many pages as you want.

    But again, learn SSI or PHP Include. It'll save you time down the road.
     

Share This Page