Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Multiple templates for one DB?

Quote Reply
Multiple templates for one DB?
Is it possible to have muliple templates for on database?

I want to setup the same database for different companies (with templates for each) but the same content shall be displayed.


Last edited by:

kjetilpalm: Oct 17, 2001, 10:03 AM
Quote Reply
Re: [kjetilpalm] Multiple templates for on DB? In reply to
Just make copies of html.pl

Then in db.cgi use a conditional statement around the require statement

if ($in{set} == 1) {
require "....html.pl":
}
elsif ($in{set} == 2) {
require "....html2.pl";
}

etc...

Then you'd use db.cgi?set=2 or whatever.
Quote Reply
Re: [kjetilpalm] Multiple templates for one DB? In reply to
Hi,
...and if you are using DBMan SQL 2.x, you can get a new param t=template_name in your link then find the line below :
my $dir_tmp = $self->{cfg}->{'template'} || $self->{glb_cfg}->{default_tpl};
in sub-routine print and replace with :
my $dir_tmp = $self->{cgi}->{t} || $self->{cfg}->{'template'} || $self->{glb_cfg}->{default_tpl};
Hope that will help,
windsorBlushCool