View Full Version : SSI shtml navigation

02-17-2010, 07:13 PM

I’m taking a first stab at an SSI navigation file, which is not working for me. The shtml file, along with the file that points to it (link1.html) is attached. In “link1.html”, the SSI code is on Line 37. I referred to two different tutorials to learn how to set this up. One provided the code:

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

and the other tutorial said it should be:

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

Also, not covered by either of the tutorials was precisely what code should be contained in the .shtml file. My assumption was, only the code that gets inserted, i.e., no body tags, header tags or anything else.

Here’s the page:


It should look like this:


This particular usage may be complicated further by the fact that this is a jquery navbar; I don’t know, but my thought was that as long as “link1.html” points to the correct nav .js files in the header tags (which it does), it should work. And our server is SSI enabled.

Can anyone tell me what I’m doing wrong?



02-17-2010, 08:30 PM
Got my answer, thank you if you took the time to consider my problem. For anyone else's benefit, the solution was:

The page that has the <!-- include file="whatever.htm" --> needs to have the .shtml extension, not the file you are including.

The file you are including can have .htm, .html. .txt or something like those. I use .htm usually so if I open it in my text editor it gets syntax highlighting.

You put exactly what you want to include in the include file. In the case of a nav like yours, you are probably talking about a div and a list, and nothing else, depending on how you setup the nav. You wouldn't need any of the head stuff in the include (html tag, head tag, dtd...none of that most likely in this case.