Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Custom & Unique Template For Each Domain

Quote Reply
Custom & Unique Template For Each Domain
Hi,

Searched Forum for the Subject and the results lead me to nowhere.

GM Standard Supports five domains D1 through D5 Say.

Would like to have unique Template Sets T1 thru T5(basically nessa) (uniqueness being due to the Image used for T1 thru T5 to identify with D1 to D5 (the header image on the left top).

D1T1 D2T2 ..... D5T5 is the combination and only combination of Domain/Template that I would wish to use.

How can I do it? And wrt changes which files need be changed if I am using the template naming convention T1 thru T5 or so to say t1 thru t5.

I know easiest way would be to have static login and signup pages with t=T1... as one of the hidden fields. However, I would not prefer it that way.

Thnx

Anup
Quote Reply
Re: [anup123] Custom & Unique Template For Each Domain In reply to
Hi Anup,

I dont know if this way can help

Replace the following lines in the login.cgi in the user dir

# Find out which template set we are on.
$t = GMail->template_set;
$IN->param(t => [$t]);


with

# Find out which template set we are on.

my $d = $IN->param('domain');

($d ) = $d =~ /(\d+)/;
if ($d){
# or some thing like that
$t= "T$d";}
else {$t = GMail->template_set;}
$IN->param(t => [$t]);


Hope that helps

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Custom & Unique Template For Each Domain In reply to
Hi,

I got following error:

GT::Template::Inheritance (9340): Wrong argument passed to this subroutine

I am on GM 2.1 and the closest to what you have stated is as follows in login.cgi:

# Update the template set with the user's default template set.
$t = GMail->template_set();
$IN->param(t => [$t]);
my $default = $USER->{users_default_template};
if ($default and $default ne $t and -e "$CFG->{location}->{path}->{data}/templates/$default") {
$USER->update_template($t) unless $IN->param('no_update');
}
$CFG->load_template_set($t);


So what changes needs to be done?


Anup

Last edited by:

anup123: Jul 3, 2002, 2:31 PM
Quote Reply
Re: [anup123] Custom & Unique Template For Each Domain In reply to
Hi Anup,

Please try this



my $d = $IN->param('domain');

($d ) = $d =~ /(\d+)/;
if ($d){
# or some thing like that
$t= "T$d";}
else {$t = GMail->template_set;}
$IN->param(t => [$t]);
my $default = $USER->{users_default_template};
if ($default and $default ne $t and -e "$CFG->{location}->{path}->{data}/templates/$default") {
$USER->update_template($t) unless $IN->param('no_update');
}
$CFG->load_template_set($t);


Ensure that you have the T1, T2, etc template on your system. If it still doesnot work let me know

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [anup123] Custom & Unique Template For Each Domain In reply to
Why not use one template set, and in that template decide what image to use depending on what domain they're using?

Adrian
Quote Reply
Re: [brewt] Custom & Unique Template For Each Domain In reply to
Hi Adrian,

For fresh login, this has been incorporated by GT.

However, it sticks onto old domain template if domain is changed on relogin.

Only changing the images is definitely most ideal situation. Question is how does a novice implement it?

Thnx

Anup
Quote Reply
Re: [anup123] Custom & Unique Template For Each Domain In reply to
The easy way:
Code:
<%if domain eq '...'%>...<%elseif domain eq '...'%>...<%endif%>
The advanced way would be to create a global which returns the image name to use.

Adrian
Quote Reply
Re: [brewt] Custom & Unique Template For Each Domain In reply to
Hi,

Thnx

Worked around and did following:

For login, added hidden fields to take to correct domain with correct template.

For relogin after logout, modified the template to have

login.cgi?t=<%template%>&domain=<%domain%>

Works fine.

Thanx 2 all.

Anup