SHTML Makes Updating Website Easy
October 25th, 2005
About a year ago, when the client services department told us that the client wants to change an element on the website sitewide, we in the html production department would frown especially if the site happened to be more than fifteen pages. Not anymore! SHTML has made our task so easy that we encourage our clients to make changes, to ensure one hundred percent satisfaction of our clients.
SHTML (Server parsed HTML) is an html document that requires parsing on the server before it is sent to the client browser. All the normal html tags work exactly same in shtml document. The only difference is that shtml document lets us include other elements into the html document. The extension of such document is as .shtml rather than .html, where S stands for Server Side Include.
Before using shtml, we need to make sure that the web hosting provider supports shtml. If not, the web server needs to be configured to provide support for server side includes. You will find directions on how to configure web server to support server side includes here: Apache.org.
Once you are sure that the web server supports shtml, this is how I use this technology to my advantage.
First, I create the html home page and save it as index.shtml. Then I isolate all the elements that repeat in all or most of the web pages of the website in a separate html documents. I save these documents as .html files. Then, in the main shtml home page, I would replace the code for each repetitive element with an include directive.
For example, let’s say the footer is same as in all the web pages of the website. I’ll copy the code for the complete section of footer such as the following:
<!– – begin footer – –>
<div id="footer">
< a href="#">home</a >
< a href="#">clients</a >
< a href="#">consulting</a >
< a href="#">services and technology</a >
< a href="#">about us</a >
< a href="#">contact</a >
< a href="#">site map</a >
</div>
<!– – end footer – –>
I would paste the above code in a new blank html document and save it as “_inc_footer.html”. You can save it with any file name you want. I like to name it starting with _inc because it tells me that this file is an include file.
Then, in all the .shtml web page with the same footer, I’ll replace the code for the footer with the following directive. Please note that there should be no space between the dash (-) and the word include below. This is because in certain servers it wouldn’t work if there’s space between the dash and the word include below. In such circumstances, the browser may show the HTML source instead of the result.
<!– –include file="_inc_footer.html" – –>
That’s how simple it is.
Now, when I need to change the file name in the footer, I need to update only _inc_footer.html. Hence, the advantages of using shtml technology to update websites cannot be stressed enough.
