Click to See Complete Forum and Search --> : SSIs - Best method for constant header and menu?


bogbrushian
07-23-2005, 08:38 PM
Hi,

I'd like some advice on using SSIs, or another method if more appropriate. I want to have my header and main links on the page constantly and don't want to use frames, especially since I am using the XHTML 1.1 doctype.

To me the idea of the header/links code being sent with every document seems like bandwidth going to waste. Is this, however, the best way of doing this? Are CSIs recommended?

Also, is there a fairly simple way of manipulating a single include each time before it is added to the html document? This is because I am using CSS buttons and the page that the user is visiting has it's button "turned on" (highlighted). I would simply need id="on" to be added to the corresponding hyperlink tag.

Thanks for your advice

invertedpanda
07-23-2005, 10:10 PM
If your header is more than 5-10k, then yeah, I'd say you might want to look into a way to do client side includes - Otherwise SSIs are fine.

As far as changing the link highlighting, I'm not sure - best guess I could give is have a server side script (PHP is my language of choice) look at what page is being requested and set the appropriate highlight or whatever. I'm not sure if that is entirely possible, but it'd be something to look into.

rritchey
07-23-2005, 11:18 PM
You could look at XMLHttpRequest. That way you can actually pick and choose what gets updated and where.

Just a thought.

bogbrushian
07-24-2005, 12:26 PM
ok thanks for the ideas. i welcome any other suggestions.

ray326
07-24-2005, 08:10 PM
If you're dynamically generating the pages through PHP or such then it's pretty easy to insert classes like that on the fly. An alternative shown here by Fang is to give each page a unique ID then tag each of the menu items with an ID and style that item ID based on its container ID. I.e. when they match they're "special."

bogbrushian
07-25-2005, 02:43 PM
cheers