HTML
  Home arrow HTML arrow Page 5 - Using SSI to Boost Efficiency
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Using SSI to Boost Efficiency
By: Clay Dowling
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 7
    2004-08-16

    Table of Contents:
  • Using SSI to Boost Efficiency
  • Enabling SSI
  • Simple SSI Directives
  • How to Use SSI
  • Navigation Menus
  • Common HTML Blocks
  • Business Considerations

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using SSI to Boost Efficiency - Navigation Menus


    (Page 5 of 7 )

    Every website has, or should have, navigation menus to make getting around the site easy. For the most part, these menus are the same on every page.  Even with a complex site, you'll have large numbers of pages with the same menus. That makes them a natural for managing with SSI.

    A good example of a navigation menu from my site is below:

    <span class="menuitem">
     <a href="/">Home</a>
    </span>
    <span class="menuitem">
     <a href="index.html">miniCMS</a>
    </span>
    <span class="menuitem">
     <a href="screenshots.html">Screen Shots</a>
    </span>
    <span class="menuitem">
     <a href="ptml.html">PTML</a>
    </span>
    <span class="menuitem">
     <a href="download.html">Download</a>
    </span>

    If I save this to the file "menu.shtml" I can now put the menu in all of my pages with the directive:

    <!--#include virtual="menu.shtml" -->

    The files included by a #include directive are also parsed for include directives. This means I can put a uniform page header on all my pages and make the menu part of that header. I'll put this bit of code in a file called "top.shtml":

    <div class="banner">
    <img src="images/miniCMS.jpeg" alt="miniCMS Logo">
    </div>
    <div class="menu">
    <!--#include virtual="menu.shtml" -->
    </div>

    Through the magic of CSS we can also use our menu to make a nice navigation bar at the bottom of the page in "bottom.shtml":

    <div class="footer">
    <hr align="center">
    <div class="menu">
    <!--#include virtual="menu.shtml" -->
    </div>
    <p>&copy; 2004 by Megacorp Inc.</p>
    <p><a href="mailto:webmaster@megacorp.net">Comments &amp; Questions</a></p>
    </div>

    Now when we add new pages to our website, the only place where we have to add a link to the page is in "menu.shtml". It will automatically appear in both the main menu at the top of the page and at the little bottom menu.

    I have also successfully used a CGI program to generate my menus dynamically. Given how easy it is to maintain a single include file, I only recommend the CGI approach in situations where you're looking to generate a menu that changes based on context.  This could be good, for instance, where the menu shouldn't have an active link for the current page. In that case you'd use #exec instead of #include.

    More HTML Articles
    More By Clay Dowling


     

    HTML ARTICLES

    - Using a 3D HTML Table as a Recordset
    - Building a 3D HTML Table
    - Maximizing and Restoring HTML Images: Layer ...
    - Completing Construction of a Database Form w...
    - Maximizing and Restoring Images in a Tabular...
    - Building the Recordset for an HTML Database ...
    - Laying Out a Database Form with HTML
    - Tabular Database Form Functions with HTML
    - Tabular Database Forms with HTML
    - Using the Find Functions for HTML Database F...
    - Sorting for Database Forms with HTML
    - Edit and Other Database Form Functions with ...
    - More Database Form Functions with HTML
    - Database Form Functions with HTML
    - Using the HTML Table Element as a Recordset






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT