adjusting a "site stadard" header file

He has: 688 posts

Joined: Feb 2001

I was wondering how to get around this situation: I've got a header and footer file that get called by all my pages. The header file starts with and ends after the tag and the menu with a where the main content for each page begins. My question is how do I make adjustments to something in the header file for individual pages? For instance, lets say that I have one single page that I want to change the body background color, or just one page that needs something added to the section for a javascript, or some similar situation where I need to change just one part of the header file? Is there something I can do other than copying that whole header file into that one page to make the adjustment (because before you know it I'll have dozens of "exceptions to the rule" and then making a change to all would involve a lot of extra work.

If it helps, I'm writing my new site in html but on pages with a .php extention so I can use php if needed.

Thanks again.

(damn I wrote a lot for one simple question Smiling)

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

you can test for the page name or variable, and if ($pagename) { whatever} else {default} in the header.

In <? ?> of course.

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

can u repeat the question? i odn't get it

Busy's picture

He has: 6,151 posts

Joined: May 2001

Which ever way you do it you'll end up with added pages or added content, say you wanted to have 3 different background colors, you could use a CSS class: .bgcolor1 (background:????Wink .bgcolor2 (background:????Wink . bgcolor3(background:?????Wink and put class="bgcolor?" into the body tag, using PHP would make it easier (add Suzanne's bit here) but still not perfect as could invlove any if statements and extra files or lines of code

In short there is no "easy" way to do it, not as easy as single header, footer sections

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

ow, i'm slow, after reading it about 10000000000 times i understood it, yeah i agree, use suzannes method Smiling

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.