Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

SSI & build_root_url -- help ?

Quote Reply
SSI & build_root_url -- help ?
Hi, On the several templates for the pages I want to include some text using SSI. It works great on the the index.html page where I just use include virtual="cgi-bin/xxxxxx" but it doesn't work on pages in subdirectories...

I tried including the build_root_url var. in the SSI statement but this doesn't work....

Can someone help me out? Thanks....
Quote Reply
Re: SSI & build_root_url -- help ? In reply to
It doesn't work in subdirectories, because the path is different (remember, the subcategory index pages are one directory level deeper then their predecessor).

Meaning:

a category can use /cgi-bin/prog.cgi
but a subcat may need ../cgi-bin/prog.cgi.

What you should do is try with the entire absolute path, not a relative one, and see if that works.

--mark
Quote Reply
Re: SSI & build_root_url -- help ? In reply to
Thanks for the reply Mark,

That is indeed what the problem is. It only becomes quite difficult to insert a lot (of long) SSI code into all of the templates where the only thing that needs to change is only 8 characters long.

I am configuring links and trying it on a local linux box and want to upload it to my isp when it is completely configured. However, locally I use the address 10.0.0.20 and I hate to have to change it in all of the templates.

This is how I am handling it right now....
(or trying to)
I want to add 2 new tags :
<%bam0%> and <%bam1%>
0 as SSI opener and 1 as SSI ender

This way I could enter code like this into the templates :
<%bam0%>front<%bam1%>

bam0 would be ´ <!--#virtual include="http://local/cgi-bin/bm.cgi?group=" ´
bam1 would be ´ "--> ´

This would generate the following :
<!--#virtual include="http://local/cgi-bin/bm.cgi?group="front"--> and would fix the problem... I am only starting in Perl and have succesfully completed some code.

At this moment I have the following defined in links.cfg

$bam0 = "\<\!--\#include virtual=\"http://local/cgi-bin/bm.cgi\?group="

$bam1 = "\"--\>"

I want this to become a tag however instead of a variable... Can anyone tell me how I can do this?

Thanks in advance
Quote Reply
Re: SSI & build_root_url -- help ? In reply to
Hi all, we're a little bit closer to the solution... This is what I have at the moment....

In the links.cfg I have put these values :

$bam0 = "\<\!--\#include virtual\=\"http://10.0.0.20/cgi-bin/bm.cgi\?group\=";
$bam1 = "\"--\>";


In site_html_templates.pl I have this :

%globals = (
bam0 => $bam0,
bam1 => $bam1,
date => &get_date,
time => &get_time,
db_cgi_url => $db_cgi_url,
build_root_url => $build_root_url,
site_title => $build_site_title,
css => $build_css_url,
banner => ''
);

All seems to get through fine, except for the fact that I get a [an error occurred while processing this directive] on my pages.

I think we're pretty close now... Can anyone round this up ?
Quote Reply
Re: SSI & build_root_url -- help ? In reply to
Frustrated with the SSI directives I replaced the absolute path to a relative path. Of course it works on the homepage but not on the subdirectoried pages, which is the aim of the whole endeavour....

Is there a way to get the absolute path to work or is there a way to build 'on-the-fly' relative paths (../../../..) based on some additional code to be included in links ?