98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsPrevious article Next article Dreamweaver articles
Saving Time With Server Side Includes
Wed 6th January 2010
What is a Server Side Include?
An example - most websites have the same menu bar at the top, or perhaps the same writing at the bottom - copyright information, privacy policy or contact details. Once you've written the code for this, you don't want to repeat yourself for every page in the site. Even if you were using a template, you would still have to make the alterations when uploading the site to the server (giving each 'spawned' page from the template a new file name, for starters). Using a Server Side Include means that all pages are changed simultaneously and you only need to update one page - not them all.
The clue is in the name - you write the code, upload it on the server, and it includes it on the side, without any further input from you, the designer.
How to Use Them
Server Side Includes can be any 'standard' design page - html or asp. Include the code (usually just one line), in the page that you want the code to be operable in (usually all of them, in case of future updates).
Then there's an 'include file' - when you make a change to it, the rest of the pages follow suit, and the beauty of this is that it's at server level, rather than designer level, so you don't have to do any additional work (that's always a bonus, right?). In Dreamweaver, there's a built-in function for this, found under Insert - Server Side Includes. Then choose your include file and away you go.
Some Caveats
Although a reasonably flexible tool, Server Side Includes won't work with any other files apart from HTML or ASP extensions. Also, your include file shouldn't have any of the classic html, head or body tags within it since it should consist of code and code alone, or else the server may read it incorrectly. Another caveat is that with ASP, make sure you're sticking to that extension for security purposes - you don't want to inadvertently create a hole in your security with this little piece of unsecured code. Finally, all the file paths must be relative - but you knew that already, right?
Conclusively, Server Side Includes are never going to replace more advanced coding tools like CGI in webpage design, but it's a useful weapon to have in your Dreamweaver design arsenal.
Author is a freelance copywriter. For more information on dreamweaver, please visit https://www.stl-training.co.uk
Original article appears here:
https://www.stl-training.co.uk/article-705-saving-time-with-server-side-includes.html
London's widest choice in
dates, venues, and prices
Public Schedule:
On-site / Closed company:
TestimonialsRetailMeNot
Customer Support Executive Tunde Suhai Excel Intermediate I personally preferred the morning section, i could pay more attention, but this is my personal preference. Otherwise all was great! RetailMeNot UK Ltd
Business Development Executive Caroline Matthews PowerPoint Intermediate Advanced Lost concentration by the afternoon. Would prefer half day or split into two sections. Good content overall though! Saunderson House Limited
Financial Administrator Sara Fykin Excel Introduction Very good course very useful very enthusiastic trainer, very knowledgeable and made sure we were all listening and taking part etc would definitely recommend. |
PUBLICATION GUIDELINES