Gossamer Forum
Home : Products : DBMan : Customization :

ssi include file for page header/footer

Quote Reply
ssi include file for page header/footer
I'm sure this has been answered on this site but I need some help! I would like to use our generic header/footer files to replace the dbman header/footers. What files (I'm thinking the html.pl file) need to be modified and what modifications do I need??

Thanks!
Quote Reply
Re: [dawg821] ssi include file for page header/footer In reply to
The easiest solution would be to use the sub include coding in this thread:

http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=11174#11174

You would use the call to the sub from your html_page_top and html_page_bottom, if you are using the user friendly mod. If using the default html.pl file you will have to manually change various subs.

I would highly suggest using the user friendly mod that JPDeni created to make life easier. Or check out the FAQ noted below under "SSI" for other ideas.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] ssi include file for page header/footer In reply to
Hi Lois,

Thanks for your help. I am still having problems. I downloaded the user friendly file from JP DENNI, and added the following to the html.pl file:

sub include {
#------------------------------------------------
my $file = shift;
open (FILE, "$file") or die "Can't open $file ($!)";
print (FILE);
close FILE;
}

The include statement reads like this:

&include ("/opt/local/software/www/ops/header.html");

This runs, but my syntax is probably off on the include. It displays the include command?

I'm sure this may be a simple fix. Do you have any idea on what I need to fix?

Thanks!!

fletch
Quote Reply
Re: [dawg821] ssi include file for page header/footer In reply to
What you would want is text files not an html file to use as your header and footer.

Dont' forget to end the print statement before you add this to your page_top or page_bottom for example:

|; &include ("cookside.txt"); print qq|

I'm not sure this will work using a path, but can be used as a relative link from your db file directory, or a copy to be used within the database. I use a separate text file within my db directories as they include my side menus which would have different url to the static page links or the page bottom which would have different links to the graphics.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] ssi include file for page header/footer In reply to
Lois,

Your code worked like a charm! I did not think html versus txt files for headers. Thanks again for your help!Smile
Quote Reply
Re: [dawg821] ssi include file for page header/footer In reply to
Hi Lois,

One more question! What subs will need to be modified? I used the regular html.pl file to create the template for another db and was wondering how difficult it would be to modify it?

Thanks again for all your help!

fletch
Quote Reply
Re: [dawg821] ssi include file for page header/footer In reply to
You would add the call to the sub for the headers after the <body> tags for each sub. Just search for "<body" and place your call in each sub you find.

And then after the call to the footer for instance:

|;
&html_footer;
&include ("dbfoot.txt");
print qq|

Hope this helps

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] ssi include file for page header/footer In reply to
Lois,

Your code worked like a charm! Thanks so very much!!
Quote Reply
Re: [LoisC] ssi include file for page header/footer In reply to
I was just starting to grumble about not being able to use my SSI template elements for the rest of the site in the DB, when I ran across this post. It worked great and thanks!

Last edited by:

shalom777: Oct 16, 2003, 6:35 AM