Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: Server Side Includes  (Read 734 times)
0 Members and 1 Guest are viewing this topic.
KevinR
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: January 06, 2003, 11:36:00 AM »

I use server side includes to include a header and footer html file in all my pages to save time.  Here's the problem.  In the 'default.html' template file, I'd like to be able to use the 'virtual' tag to include my files which reside in the root directory on the server (Apache 1.3 on a Unix OS).  I should be able to type:

<--#include virtual="/header.html"-->

It doesn't work.  It just gets ignored.  I can, however, use 'file' instead.  The problem, as you all know, is that I have to have a copy of the html files in the same directory as 'default.html'.  I have tried this and it DOES work.

My question:  Does anyone know why 'virtual' does not work?

Thanks.
-Kevin

[This message has been edited by KevinR (edited January 06, 2003).]

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: January 06, 2003, 10:22:00 PM »

 
quote:
<--#include virtual="/header.html"--> It doesn't work. It just gets ignored.

Is that tag removed from the template?

Dan O.

[This message has been edited by DanO (edited January 10, 2003).]

Logged
TubaDave
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #2 on: January 09, 2003, 07:02:00 PM »

Hi Kevin,

The script handles #include file because all that takes is opening a file and copying it's contents in, something perl was designed for, so it's easy to do.  There's two relatively good ways to get around the problem of not having virtual at your fingertips:

1.  Make a symbolic link in Linux/Unix that links from the template directory to the file in your web root directory. You would execute something like:
ln -s header.html /full/unix/path/to/www/header.html
on the command line in the template directory.

2.  Make your own #include virtual function (might actually be construed as easy!):

<% use LWP::Simple; print get "http://www.mysite.com/header.html"; %>

This relies on the LWP module being installed, but it seems really common.

Take your pick.  Hope it works for you.

------------------
David Whittaker
http://www.uabcm.com
http://bama.ua.edu/~whitt013

Logged

KevinR
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #3 on: January 09, 2003, 08:12:00 PM »

Dave, what an awesome solution.  I used the perl LWP module.  Perfect!

Thanks.
-Kevin

------------------

Logged
vr6
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #4 on: October 12, 2003, 09:51:00 AM »

I am not familiar with LWP but what I am trying to do is include my standard header and footer into this calendar. I have tried through the Header / Footer fields in the Template Display Preferences with no luck.

Any help you can provide would be great.

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #5 on: October 12, 2003, 01:38:00 PM »

** I have tried through the Header / Footer fields in the Template Display Preferences with no luck. **

What exactly did you enter into those fields and what exactly was the result??

Dan O.

------------------

Logged
vr6
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #6 on: October 12, 2003, 06:02:00 PM »

Sorry for not explaining for clearly. I have a standard header and footer file which I reference from all my web pages via SSI. I would like to do the same in the calendar but using "include virtual" or "include file" has never worked.

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #7 on: October 12, 2003, 08:19:00 PM »

** using "include virtual" or "include file" has never worked. **

They definitely wouldn't work if you were entering the SSI tags into the header and footer fields of the Template Display Preferences administration screen.

According to the CalendarScript documentation it looks like the only SSI tag recognized by CalendarScript is the
<!--#include file="filename.html"--> tag which would have to be manually added to the default.html template file.

If that included file is in other than the template directory, you'd likely have to alter the path to it or put a copy in the the template directory or alter the code responsible for that operation (in the asp.inc file) to look in the appropriate directory or use TubaDave's suggestion (if your server has the LWP Perl module loaded).

Dan O.


[This message has been edited by DanO (edited October 12, 2003).]

Logged
jvandel
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #8 on: February 11, 2004, 05:40:00 AM »

Has anyone found a solution to the problem of asp filling in codes instead of the page?

otherwise to this topic. I added the line
<!--#include file="../includes/header.asp"-->
to the default.html and it was ignored. This is an iis server.

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #9 on: February 11, 2004, 07:48:00 PM »

** anyone found a solution to the problem of asp filling in codes instead of the page? **

What do you mean by filling in codes?

Dan O.

------------------

Logged
Pages: [1]   Go Up
Print
Jump to: