Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How do I use SSI in dynamic mode?

Quote Reply
How do I use SSI in dynamic mode?
I have edited the home.html template in Links SQL 2 to include the following SSI tag:
>!--#include virtual="cgi-bin/abcnews.pl?us" --<
(The <> brackets need to be reversed above, but where typed backwards above to allow the tag to appear)

When I look at the site dynamically from the links NG admin, (using page.cgi) the above ssi tag does not work. That is I get no error message and the tag does not show up as text on the browser. This happens even if the tag is incorrect and should generate an error.

I can "View Source" on the IE browser and the above tag is intact. I can save the source as "index.shtml" in my root directory and when I view that in the IE browser or by accessing STATIC from Links NG admin, the output from abcnews.pl appears correctly.

I have set the following options in the admin:

SETUP | Build Options | dynamic pages = yes
SETUP | Build Options | build_detailed = no
SETUP | Build Options | build_index = shtml
SETUP | Paths and URLs | build_root_path = /www/beaverheadriver/pages

So my question is, can server side includes be used when running Links SQL 2 in dyanamic mode using page.cgi?

And if so, what do I need to do differently?

Quote Reply
Re: How do I use SSI in dynamic mode? In reply to
AFAIK you can't directly 'execute' an SSI call from within another script, e.g.; page.cgi

An include is parsed by the server as it serves the page, whereas the script is 'run' by the server and the results are 'displayed'.

You could try using LWP::Simple to 'grab' the output of the script (this may or may not work for you):

use LWP::Simple;
$news = get("http://www.yoursite.com/cgi-bin/abcnews.pl?us");
... then pass $news to a tag:

news => $news

... than place the tag on your template:

There is another method that involves adding part of the script you want to call to the script you're calling from but that can get a bit complicated and messy.

Hope this helps.

All the best

Quote Reply
Re: How do I use SSI in dynamic mode? In reply to

I have a polling script that shows up using SSI on my home page which is static. I would like it, and the rest of my directory to be fully dynamic so I'd like to give this technique a try also. Does it matter where inside page.cgi you place these statements?

Mark Brasche
Quote Reply
Re: How do I use SSI in dynamic mode? In reply to
To be fully dynamic you need to use page.cgi, which does everything dynamically.

You can replace most SSI type calls with tags in the template to "do" things.

PUGDOGŪ Enterprises, Inc.