Gossamer Forum
Home : Products : DBMan : Customization :

A little help please with SSI

Quote Reply
A little help please with SSI
I have found some info on how to exclude html you do not want to show up when pulling a record using SSI...

*******
Add a new value to your SSI string, for example &SSI=1
eg: db.cgi?db=default&uid=default&view_records=1&ID=*&SSI=1
Then, in your html_view_success sub, just put "UNLESS" statements around the sections of HTML you don't want displayed during an SSI call. eg:
unless ($in{'SSI'}) {
print qq|
....HTML you don't want displayed....
|;
}
print qq|
....HTML You want displayed....
|;
&html_footer unless ($in{'SSI'});
*******

I got this to work only if I put the unless statement in the html_record sub routine. However I am using the user-friendly version of the html.pl file and when I try to add the unless statement in the html_view_success sub routine I get a internal server misconfiguration error when the SSI is called.

I would really like to exclude the html_page_top and html_page_bottom from the SSI results.

any thoughts?

Quote Reply
Re: A little help please with SSI In reply to
Check out the following thread in the FAQ noted below in the section "Viewing". It may provide the code changes you are looking for with the user friendly mod?

Print View: Another Viewing Option (no headers or footers)

There may be other related thread which may help also. Let us know.

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: A little help please with SSI In reply to
I've done something similar for my SSI calls, and it works without problems.
In html_view_success, I added a conditional, right after the section where $numhits and so on have been set.
# if this is an SSI call, we only print the html header
if ($in{'SSI'}) {
if (!$html_headers_printed) {
print "Content-type: text/html\n\n";
$html_headers_printed = 1;
}
# if this is not an SSI call, we print all sorts of
# html-code as well, contained in html_page_top
else {
&html_page_top;
$page_title = "$html_title: Search Results";
print qq|<h1>$html_title: Search Results</h1>
Your search returned <b>$db_total_hits</b> matches.|;
if ($db_next_hits) {print qq|
Pages: $db_next_hits
|;
}
for (0 .. $numhits - 1) {
&html_record (&array_to_hash($_, @hits));
}
unless ($in{'SSI'}) {
&html_page_bottom;
# the footer and end of html, which we only want printed
# when this is not an SSI call
}

You could also code this differently, but I think as long as you take care that the html header is printed in the SSI call, and that the begin and end parts of the page code are not printed, you should be fine.

kellner
Quote Reply
Re: A little help please with SSI In reply to
Thanks for the responses.

LoisC, The thread you suggested did not help me with the ssi problem however it will help me to add a link to the record to create a print version.

I did find a thread...
SSi:Call articles via SSI
This basically had me duplicate the View subs coding in the db.cgi and html.pl files and with some manipulation I got it to work.

Thanks again!