[thelist] CGI pass var 2 XSSI / SSI syntax / embedded Perl - 3 simple questions

rudy r937 at interlog.com
Wed Nov 14 17:19:05 CST 2001

> I want every page to call a simple SSI for the left-hand menu,
> with that file being unique to that page and ... [snip]

hi george

not sure if i can help you with the perl or cgi part...

no, wait, i am sure -- i can't

let me suggest an alternative, though

why not have just one include file, and let it "know" which page called it?

what exactly was it that the separate include files were supposed to do?

the most common feature of a nav bar is that the link to the page that it's
on is "greyed out"

<tip  type="xssi"  comment="extended server sided include">

here's how to do a "smart" nav bar using SSI

at the top of each page, set a variable called "thisis"

    <!--#set var="thisis" value="${DOCUMENT_NAME}" -->

then create an include file for the nav bar as follows

   <!--#if expr="$thisis = /home/" -->Home
      <!--#else --><a href="home.shtml">Home</a><!--#endif -->
   <!--#if expr="$thisis = /products/" -->Products
      <!--#else --><a href="products.shtml">Products</a><!--#endif -->
   <!--#if expr="$thisis = /faq/" -->FAQ
      <!--#else --><a href="faq.shtml">FAQ</a><!--#endif -->
   <!--#if expr="$thisis = /contact/" -->Contact
      <!--#else --><a href="contact.shtml">Contact</a><!--#endif -->

then just copy the nav bar include file into every page

   <!--#include file="navbar.shtml" -->

on the Home page, Home is text, not a link, and so on...

note that the include file has to get processed by SSI

the other pages are also named  *.shtml

you can change this to *.html using .htaccess



More information about the thelist mailing list