|
|
 |
SSI - Centralize Common Content
Published: Saturday, March 20, 2004
Why use Server Side Includes?
When the number of web pages increase, the complexity of keeping them up-to-date also increases tremendously. For example, if a new link is added to a navigation pane, all the pages, which display the navigation bar, will have to be updated if the nav code is not centralized. Server Side Includes (SSI) are widely used to handle such situations where the common content appears at multiple pages across a web site.
How to use Server Side Includes?
In order to use SSI, the web server should be SSI enabled. Usually all web hosts provide SSI enabled web servers because of its extensive need. The SSI file name extension depends on the operating system and the web server software used by the web hosting server. In most cases, an .htm or .asp is used for Windows based IIS (Internet Information Services) Server, .html can be used for Unix/Linux based servers running Apache. Some hosts may require the use of .shtml for SSI files. Include files can be dynamic pages (e.g. .asp for IIS). One key point is that SSI is executed before any other server side scripts (except include statement for Java Server Pages). Therefore, you cannot put any server side scripting logic to conditionally include a file. It will always be included. The code for including a SSI file on a web page is shown below:
<!--#include file="./file.ext"-->
The include file path should be relative to the location of the page which includes it. Here it assumes that the file.ext resides in the same directory as the page.
Using SSI for navigational panels
SSI is most commonly used for header bars and navigational panels of a web site. Using SSI allows the website to centralize the navigational links in one single file, which is included in all the pages of the web site. If a new link is added or any link needs to be updated, the webmaster has to update only this common file and the change is reflected in all the pages which includes it. For creating a nav include file, create a file and place the html code for the navigational links in that file. For example, a sample include file will look something like the one below with a name "navigation.htm". In order to centralize all include files, place all include files in a separate folder called "/include" under root directory.
<a href="http://www.domain.com">Home</a><br /> <a href="http://www.domain.com/services">Services</a><br /> <a href="http://www.domain.com/company">Company</a><br /> <a href="http://www.domain.com/help">Help</a><br /> <a href="http://www.domain.com/support">Support</a>
Add the include code in each of the web pages that will show the navigation panel. Remember that the place where you add the include code should be the same position where you want the navigation panel to be rendered.
<!--#include file="./include/navigation.htm"-->
|
 |
|
|
|
|
|
|
|
RELATED NEWS
|
 |
iLounge Inc., and MusicSkins LLC, Announce the Ultimate Design Contest
NEW YORK, Nov. 20 /PRNewswire/ -- iLounge Inc. announces the Ultimate Design Contest powered by MusicSkins LLC , the leader i...
|
 |
Astia Honors CEO Eva Chen of Trend Micro With Technology Innovator Award
Awards Ceremony Spotlights Women Innovators and the Venture Firms who Support Them
|
 |
Qualcomm's New Gobi2000 Technology to Deliver 3G Connectivity in Lenovo ThinkPad Laptops
- Embedded Gobi Solution Will Allow PC Users to Access Multiple Operators Worldwide -
|
 |
NI Technology Updates Outlooks for OmniVision Technologies, Intel, ARM Holdings, Qualcomm and Apple
PRINCETON, N.J., Nov. 20 /PRNewswire/ -- Next Inning Technology Research ( http://www.nextinning.com ), an online investment...
|
 |
GLOBAL Defense Technology to Ring Closing Bell at NASDAQ on Monday, November 23, 2009
MCLEAN, Va., Nov. 20 /PRNewswire-FirstCall/ -- GLOBAL Defense Technology & Systems, Inc., (GLOBAL Defense Technology, Nas...
|
|
Submit News |
View More News
|
|
|
|
RELATED CLASSIFIED ADS
|
 |
Training on IBM Mainframe technology
FEATURES:
1. State of art lab infrastructure
2. 24x7 lab accesses
3. Live mainframe environment o ...
|
 |
web design company |professional website design
Wonesty professional web design company, based in Bangalore INDIA offers creative, affordable websit ...
|
 |
Website Design Company. Web Design, eCommerce, SEO
Global Website Designing is a website develpment and http://www.globalwebsitedesigning.com/search-en ...
|
 |
Singapore Web Design, India Web Design
Web Synergies is a company with offices in both Singapore and India having over 30 programmers provi ...
|
 |
web site design, flash web site design and graphic
Hi there,
we provide web site design, flash web site design, graphic design, banner design, flash ...
|
|
Post Free Ad |
View More
|
|
|
|
|
Copyright © 2003-2009 WebsiteGear Inc. All rights reserved.
About |
Advertise |
Submit Content |
Privacy |
Agreement |
Contact
|
|
|
|
|