Hi guys, I've been designing websites for awhile but have just sort of learned things as I went along by trial and error and don't really know much about it. Someone suggested using server side includes as a way of being able to change parts of my sites easily, rather than having to go through each HTML page one by one. I see the benefit but don't really see .shtml files used very often on other people's sites. So I was curious if there's sme downside to SSI that I don't know about? Thanks! Kirsty
Kirsty, I've read around here that the file extension is way less important then it's content, so don't worry about having .shtmls. That being said, if you're on a *nix server, it's posible to set the server to parse those SSI's even on .htm or .html files. Of course PHP has it's own built in function called include that does the same thing (and can be more powerful). Check out this page for info if you don't have this info already: http://www.ssi-developer.net/ssi/enabling-ssi.shtml This is not quite what you asked, but I've found one annoywance is that if you use certain version of dreamweaver, it will sometimes try to show the contents of the SSI in WISYWIG mode and when you save the file it will get messed up. That's just a minor thing that probably won't effect you, but could cause headaches.
There are no real downsides, I just use a text editor though. It means you can include a menu file or footer file and change the whole site by changing only one file.
SSI's are useful in certain circumstances. Rather than focus on individual techniques I would encourage you to first sit down and plan out a strategy for your website as a whole. For example, if your website is not 'dynamic' - ie. it does not make use of server side scripting such as PHP and ASP, but does have a large number of pages and a single design, SSI's would be a good choice. An alternative to SSI's in this case would be to incorporate the menu into each HTML page and use regular expressions in your favourite text editor to modify the menu in each file each time. The latter is the route I would choose since you're reducing server load (a very little), and maintaining a clean site structure. If you're running a fully dynamic site with a server side scripting language, you might be tempted to build your menu dynamically, either from database elements or, as Roze says, using your language's own include feature. Ultimately it's a trade off between saving yourself time, and best practices (often, the two go hand in hand). I have a nasty habit of getting drawn into using things because I think they're 'new or cool' - which is a bad idea. Whatever works best while adhering to standards is the way to go. On a side note - if you haven't already, next time you're in London make sure you get to Fabric.
ssi's are a little slower to serve since the web server has to open up a few files read them and then send them, where sometimes if can instead mmap a file and send it directly, or at the most has to open just one file and send it.
I'd recommend php if your server can run it, it's easy and lots of scripts available to help build your pages.
this is no downsides at all; extra processing costs nothing compared to the retrieveing and sending data back to client - so use it in full!