Link to home
Start Free TrialLog in
Avatar of Melody Scott
Melody ScottFlag for United States of America

asked on

SSI: The Include Command

Hi, Im using instructions on this page to try to include some navigation on all pages using SSI: http://www.htmlgoodies.com/beyond/webmaster/article.php/3473341

the site cart is in PERL, and I can't use PHP.

I go through "Can You Run SSI?" and I can, I see the day of the week on the test page, as long as the extension is shtml.

But when I then add <!--#include virtual="/virtual/left-sidebar.shtml" --> into my page, I don't get the navigation I've placed. The site is in Bootstrap, could there be some problem there?

the site is dev2.magickitchen.com, user melody. pw attached.
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

An "include virtual" starts looking at the server root. For example, if your directory structure looks like:

/public_html
                       /virtual
                                   /left-sidebar.shtml

...then your path might need to be:
<!--#include virtual="/public_html/virtual/left-sidebar.shtml" -->

Optionally, you can just use "include file" if you want to specify a relative path. For example:

Let's say your main page is:
/public_html/index.html

Your includes are in:
/public_html/virtual/left-sidebar.html

In index.html, you would do:
<!--#include file="virtual/left-sidebar.shtml" -->

Notice the lack of the initial slash.
Avatar of Melody Scott

ASKER

Thank you. It's still not working, however, if you view the page navigation should appear in the left column.
ASKER CERTIFIED SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That's right, it's shtml, because with the test given on the page I mentioned, html didn't work, but shtml did. I only have one file at the moment, so I'll give this a try. Thanks,

(Oh, also, I do see <!--#include ... --> line in the source, so it's not trying to call it.
That's just not working, so there must be something server-side that's not allowing it. Thanks for your help.