Server Side Includes - SSI Examples
The top menu, the entire left sidebar and the footer at the bottom have been inserted using server side includes. If you view the source, you will not see any of the directives to insert the includes just the actual codes for the top menu, sidebar and footer. The code to insert the includes is:
<!--#include virtual="top-menu.txt" -->
<!--#include virtual="section-menu.txt" -->
<!--#include virtual="article.txt" -->
<!--#include virtual="social-media.txt" -->
<!--#include virtual="world-connect.txt" -->
<!--#include virtual="footer.txt" -->
The above code ONLY WORKS if the include is located on the same level as the file it is being inserted in to.
If the page you want to insert the include is down one or two levels (folders) then you would need to add ../ for each level.
When you are working with SSI's on your computer, this is what your
page will look like
Screenshot
of page on hard drive.
Screenshot of html code for the page on your computer. When you upload your files to your freepages server, what you see is the page showing in your browser window. The include has been inserted into the page before you view it.
Additional resources:
- SSI: The Include Command
- Introduction to Server Side Includes
- Beginner's Guide to SSI (server side includes)
- What are Server Side Includes, and how do I use them? (Indiana University)
- Cheri Zuber's SSI Tutorial
Return to Server Side Include Tutorial