Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Over Achiever

macrumors 68000
Original poster
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?
 
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>.
 
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.
 
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.
 
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.

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.
 
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.

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.