SSI

M

matty

Hello, I have a simple question that is killing me. I have a site that
displays content in three frames. A top frame which is the title of the
page, a sidebar which is the menu, and the center is for content. I am
currently using tables to display this content. I have in the past done
this with ASP I believe but am not sure. I am looking for an eaiser way to
display this content without using the frames tag or tables that need to be
updated on every page. I basicly am looking for a template. For instance
I only need to update the side bar menu once and it is propagated
throughout the site. I am running this fram a Linux server w/ Apache. I
looked at the Apache tut on their website at SSI but don't really know if
this is what I want. I have tried creating a html file with the necessary
code for the title and then I added <!--#include virtual="/footer.html"
--!> to the page but it didn't work. Both files are in the same directory,
I have already made sure that they see each other. Any thoughts on how to
do this? Am I one the right path and it is a simple codeing error? If
anyone has any links to good tutorials or the like I would be greatful.
Thanks

-Rules And Models Destroy Genuis And Art-
-Caffiene is not a drug, its a food group-
 
C

Carolyn Marenger

matty said:
Hello, I have a simple question that is killing me. I have a site that
displays content in three frames. A top frame which is the title of the
page, a sidebar which is the menu, and the center is for content. I am
currently using tables to display this content. I have in the past done
this with ASP I believe but am not sure. I am looking for an eaiser way
to display this content without using the frames tag or tables that need
to be
updated on every page. I basicly am looking for a template. For instance
I only need to update the side bar menu once and it is propagated
throughout the site. I am running this fram a Linux server w/ Apache. I
looked at the Apache tut on their website at SSI but don't really know if
this is what I want. I have tried creating a html file with the necessary
code for the title and then I added <!--#include virtual="/footer.html"
--!> to the page but it didn't work. Both files are in the same
directory,
I have already made sure that they see each other. Any thoughts on how to
do this? Am I one the right path and it is a simple codeing error? If
anyone has any links to good tutorials or the like I would be greatful.
Thanks

-Rules And Models Destroy Genuis And Art-
-Caffiene is not a drug, its a food group-

If the file is in the same directory, you would want to specify:
<!--#include virtual="./footer.html"--> . The ./ refers to the current
directory. / alone refers to the root directory. You might also be
running into server issues, like SSI being disabled, or not configured
appropriately for your usage. SSI may restricted to a specific directory.
Those questions are better directed to your hosting company or to an apache
related news group.

But first of all, stick to the path you are on, and just fix the path. (A
little geek humour!)

Carolyn
 
G

Greg N.

matty said:
I have tried creating a html file with the necessary
code for the title and then I added <!--#include ...

If SSI is supported at all on your server, chances are that it is
configured to require your file type to be SHTML instead of HTML.
 
M

matty

If the file is in the same directory, you would want to specify:
<!--#include virtual="./footer.html"--> . The ./ refers to the current
directory. / alone refers to the root directory.

Tried that, no luck. Thanks for the tip though.

You might also be > running into server issues, like SSI being disabled,
or not configured appropriately for your usage. SSI may restricted to a
specific directory. Those questions are better directed to your hosting
company or to an apache related news group.

My next step is to contact them to see what is enabled. Then ask an Apache
group
But first of all, stick to the path you are on, and just fix the path. (A
little geek humour!)

Carolyn

Thanks for the help.
 
M

matty

Greg said:
If SSI is supported at all on your server, chances are that it is
configured to require your file type to be SHTML instead of HTML.
Tried that, no luck. Thanks for the tip though. I am going to contact my
hosting company and see what is enabled and not. I amy be out on a limb
here but is this something I can do with PHP? It is on my list of things
to play with and this might be a good push for me to dig into it.
 
S

Stan McCann

Greg N. said:
If SSI is supported at all on your server, chances are that it is
configured to require your file type to be SHTML instead of HTML.

Or may be configured using the XHackbit in which you must place the x
bit on the file's attributes. I have several servers configuted like
that. I didn't like the shtml option.
 
S

Stan McCann

Tried that, no luck. Thanks for the tip though. I am going to
contact my hosting company and see what is enabled and not. I amy
be out on a limb here but is this something I can do with PHP? It
is on my list of things to play with and this might be a good push
for me to dig into it.

It uses different syntax, but yes, PHP will work too if installed.
<!--#include ... becomes <?php include ("path/include.file"); ?> or if
including files that may contain code that can't be redefined, use the
include_once() function instead of include().
 
J

JDS

I amy be out on a limb
here but is this something I can do with PHP?

In a word, "YES"

PHP is a far more flexible and powerful solution than SSI, which is why
SSI is not used so much anymore. But to more completely answer, in PHP,
the one-liner is:

<?php include("footer.html"); ?>

And to more completely complete answer, there are many ways to skin this
cat. From simple header/footer includes to complicated content management
systems (CMS), from build-your-own to install an existing system. If you
need to do anything more complex than headre/footer, I recommend you just
use someone else's already-available templating solution or CMS rather
than buid your own. see http://www.opensourcecms.com, for example.

later...
 
J

JDS

If the file is in the same directory, you would want to specify:
<!--#include virtual="./footer.html"--> .

Or, um, how about no dot or slash at all?

<!--#include virtual="footer.html"-->
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top