SHTML troubles ... help requested

OT: anything goes!

Moderator: Edi

Post Reply
User avatar
Durandal
Bile-Driven Hate Machine
Posts: 17927
Joined: 2002-07-03 06:26pm
Location: Silicon Valley, CA
Contact:

SHTML troubles ... help requested

Post 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?
Damien Sorresso

"Ever see what them computa bitchez do to numbas? It ain't natural. Numbas ain't supposed to be code, they supposed to quantify shit."
- The Onion
User avatar
Exonerate
Sith Marauder
Posts: 4454
Joined: 2002-10-29 07:19pm
Location: DC Metro Area

Post 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...

BoTM, MM, HAB, JL
User avatar
Darth Wong
Sith Lord
Sith Lord
Posts: 70028
Joined: 2002-07-03 12:25am
Location: Toronto, Canada
Contact:

Re: SHTML troubles ... help requested

Post 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.
Image
"It's not evil for God to do it. Or for someone to do it at God's command."- Jonathan Boyd on baby-killing

"you guys are fascinated with the use of those "rules of logic" to the extent that you don't really want to discussus anything."- GC

"I do not believe Russian Roulette is a stupid act" - Embracer of Darkness

"Viagra commercials appear to save lives" - tharkûn on US health care.

http://www.stardestroyer.net/Mike/RantMode/Blurbs.html
User avatar
Mad
Jedi Council Member
Posts: 1923
Joined: 2002-07-04 01:32am
Location: North Carolina, USA
Contact:

Post 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.
Later...
User avatar
Dalton
For Those About to Rock We Salute You
For Those About to Rock We Salute You
Posts: 22640
Joined: 2002-07-03 06:16pm
Location: New York, the Fuck You State
Contact:

Post by Dalton »

It should. His site is hosted by me.
Image
Image
To Absent Friends
Dalton | Admin Smash | Knight of the Order of SDN

"y = mx + bro" - Surlethe
"You try THAT shit again, kid, and I will mod you. I will
mod you so hard, you'll wish I were Dalton." - Lagmonster

May the way of the Hero lead to the Triforce.
User avatar
Lord Edam
Padawan Learner
Posts: 189
Joined: 2002-07-18 08:52am
Contact:

Post 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)
User avatar
Durandal
Bile-Driven Hate Machine
Posts: 17927
Joined: 2002-07-03 06:26pm
Location: Silicon Valley, CA
Contact:

Post 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?
Damien Sorresso

"Ever see what them computa bitchez do to numbas? It ain't natural. Numbas ain't supposed to be code, they supposed to quantify shit."
- The Onion
User avatar
Darth Wong
Sith Lord
Sith Lord
Posts: 70028
Joined: 2002-07-03 12:25am
Location: Toronto, Canada
Contact:

Post 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.
Image
"It's not evil for God to do it. Or for someone to do it at God's command."- Jonathan Boyd on baby-killing

"you guys are fascinated with the use of those "rules of logic" to the extent that you don't really want to discussus anything."- GC

"I do not believe Russian Roulette is a stupid act" - Embracer of Darkness

"Viagra commercials appear to save lives" - tharkûn on US health care.

http://www.stardestroyer.net/Mike/RantMode/Blurbs.html
User avatar
Darth Wong
Sith Lord
Sith Lord
Posts: 70028
Joined: 2002-07-03 12:25am
Location: Toronto, Canada
Contact:

Post 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.
Image
"It's not evil for God to do it. Or for someone to do it at God's command."- Jonathan Boyd on baby-killing

"you guys are fascinated with the use of those "rules of logic" to the extent that you don't really want to discussus anything."- GC

"I do not believe Russian Roulette is a stupid act" - Embracer of Darkness

"Viagra commercials appear to save lives" - tharkûn on US health care.

http://www.stardestroyer.net/Mike/RantMode/Blurbs.html
Post Reply