Gossamer Forum
Home : Products : DBMan : Customization :

Another Template Question

Quote Reply
Another Template Question
Pardon me if I missed this answer in a previous post.

I am curiuos to know if anyone has integrated a multiple template (header/footer) mod? What I am interested in doing is a way to dynamically switch out a header and footer (maybe even the layout of the data) based on a category. For example. If a search pulls up records from cat1, cat2, and cat3 then clicking from short result to long result would yield a different look.

if cat1 then layout1
elseif cat the layout2 and so on.

Is this possible or am I just off.

Thank you,
Michael J. Sammut

[This message has been edited by MJ (edited August 17, 1999).]
Quote Reply
Re: Another Template Question In reply to
Eliot--

You gave him some code. I won't worry about adding any more info unless the code you gave him doesn't do what he wants. Smile


------------------
JPD





Quote Reply
Re: Another Template Question In reply to
Hi,

Well I tried our the code. It workd darn good for doing a browser based insertion, but I it is not quite hitting the mark for categories.

I appreciate everyone's help.

Yes, carol I agree, with your desire to keep these threads as clean and efficient as possible with not insertig to much extra code.

Thanks Elliot :-)
Quote Reply
Re: Another Template Question In reply to
I have creating a header and footer file into my DBMAN files. It would take some tweaking with the sub query in the db.cgi file to cordinate with the search terms or category search.

To put a header and footer in your DBMAN pages, you can use the following codes:

Code:
sub header_file {
# ---------------------------------------------
# Displays the number of accounts

my (%patterns) = (
'MSIE' => 'header.htm',
'Mozilla\/4' => 'header.htm',
'Mozilla\/3' => 'header.htm',
'Mozilla\/2.02' => 'header.htm',
'Mozilla\/2' => 'header.htm',
'Mozilla\/1' => 'header.htm',
'Other' => 'header.htm'
);
foreach (keys %patterns) {
if ($ENV{'HTTP_USER_AGENT'} =~ /$_/) {
open (INC, "C:/Inetpub/wwwroot/Coconino/~hr/$patterns{$_}") or return "Can't find include file: $patterns{$_}";
return join ("", <INC> );
}
}
open (INC, "/path/to/patterns{'Other'}") or return "Can't find include file: $patterns{'Other'}";
return join ("", <INC> );
}

# This prints out footer file that is inserted into web pages.
#
sub footer_file {
# ---------------------------------------------
# Displays the number of accounts

my (%patterns) = (
'MSIE' => 'footer.htm',
'Mozilla\/4' => 'footer.htm',
'Mozilla\/3' => 'footer.htm',
'Mozilla\/2.02' => 'footer.htm',
'Mozilla\/2' => 'footer.htm',
'Mozilla\/1' => 'footer.htm',
'Other' => 'footer.htm'
);
foreach (keys %patterns) {
if ($ENV{'HTTP_USER_AGENT'} =~ /$_/) {
open (INC, "C:/Inetpub/wwwroot/Coconino/~hr/$patterns{$_}") or return "Can't find include file: $patterns{$_}";
return join ("", <INC> );
}
}
open (INC, "path/to/$patterns{'Other'}") or return "Can't find include file: $patterns{'Other'}";
return join ("", <INC> );
}

Change the /path/to/ to the directories where your footer and header files are located. Place these codes in your db.cgi file.

You will notice that these codes place header and footer files based on browser the user is using.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited August 17, 1999).]
Quote Reply
Re: Another Template Question In reply to
I don't know that anyone has done anything similar, but I would imagine that it could be done. I'd have to think about it a little bit.

If I understand you correctly, you want a different html_record (or html_record_long) depending on the value of one of the fields in the search results. Right?


------------------
JPD





Quote Reply
Re: Another Template Question In reply to
I will try your routine Elliot. It looks like it is what I could use, Thank you!!

And yes Carol, your description of what I want is correct.

I have a test site on a local server that has about 4000 records divided into 5 categories. I thought to be able to add some more design (based on template to them) could be a useful feature.

Thank you !!

------------------
Quote Reply
Re: Another Template Question In reply to
MJ,

I am thinking off the top of my head here. But you may be able to use the codes I gave and modify them for categories rather than web browsers...

Hmmm....let me see if I can come up with something.

Although Carol (JPDeni) is a wiz at customizing DBMAN. She may have other ideas that may help you as well.

Smile

Regards,



------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited August 17, 1999).]
Quote Reply
Re: Another Template Question In reply to
Gee

Thank you very much!!!