Page 1 of 1

SHTML troubles ... help requested

Posted: 2003-02-16 10:22pm
by Durandal
OK, I'm looking to migrate my site over to SHTML mainly because of the convenience of doing virtual includes. This seems simple enough. I just need to put the navigation code in its own file and replace the existing text with

Code: Select all

<!-- #include virtual="nav.html"-->
if the index and the nav.html file are in the same directory, right? It's not working. No browser I've tried likes the idea, and I was sure to rename the file to index.shtml. I just get a blank right table column. I've also been unable to find any half-way decent tutorials on SHTML. Anyone have any suggestions?

Posted: 2003-02-16 11:20pm
by Exonerate
You sure your server supports SSI?

Dunno, put a space between your quote and dash? From what I can tell, there's nothing wrong with it...

Re: SHTML troubles ... help requested

Posted: 2003-02-16 11:58pm
by Darth Wong
Durandal wrote:OK, I'm looking to migrate my site over to SHTML mainly because of the convenience of doing virtual includes. This seems simple enough. I just need to put the navigation code in its own file and replace the existing text with

Code: Select all

<!-- #include virtual="nav.html"-->
if the index and the nav.html file are in the same directory, right? It's not working. No browser I've tried likes the idea, and I was sure to rename the file to index.shtml. I just get a blank right table column. I've also been unable to find any half-way decent tutorials on SHTML. Anyone have any suggestions?
My creationism website uses shtml files almost exclusively, and it always works.

One tip: don't test the file by loading it directly off your hard drive and into your web browser. You have to set up a webserver, make sure it's configured to enable server-side includes, and access it that way.

Posted: 2003-02-17 01:27am
by Mad
SHTML files require SSI, or Server Side Includes. As the name implies, SSI requires the server to support them. The server parses the SHTML file for the special comments, and replaces them with whatever the tag tells it to. In the case of the virtual includes, it's the entire contents of the referenced file. The browser never sees the SSI tag. So you'll need to ensure that your server supports SSI, and you'll have to test your pages by accessing them from the server.

Posted: 2003-02-17 02:11am
by Dalton
It should. His site is hosted by me.

Posted: 2003-02-17 11:23am
by Lord Edam
1. - make sure you are using the correct extension. It might be SHTML, SHTM, STM, or even just HTM/HTML depending on how your server is set up. If you don't know ask your administrator. If you can use HTACCESS files, setup the extension you want to use yourself in there

2. - you aren't in the root directory on Daltonator.net, so try changing it to

Code: Select all

<!-- #include virtual="durandal/my/direcotry/nav.html"--> 
(virtual requires a virtual path relative to the webroot)

or

Code: Select all

<!-- #include file="nav.html"--> 
(file requires a pathname relative to the current directory)

Posted: 2003-02-17 12:49pm
by Durandal
Ahh ... I've been testing it off my local drive. There's no way to test the pages locally then? Could I enable my Apache web server and do it?

Posted: 2003-02-17 01:05pm
by Darth Wong
Durandal wrote:Ahh ... I've been testing it off my local drive. There's no way to test the pages locally then? Could I enable my Apache web server and do it?
Precisely. Enable your Apache web server. SSI should be enabled by default for files ending in .shtml.

Posted: 2003-02-17 01:09pm
by Darth Wong
BTW, if it isn't enabled, load up the commonhttpd.conf file and search for "server-parsed". That should take you to the part of the file which allows you to enable SSI.