Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Re: Template2 - Different Category Templates Mod

Quote Reply
Re: Template2 - Different Category Templates Mod In reply to
It is possible by using one of the following methods:

1) Hack sub site_html_link in HTML_Templates.pm

Code:

if ($rec->{'CategoryID'} eq '19') {
$template = "link2.html";
}
else {
$template = "link.html";
}


Then replace link.html with $template in the following codes:

Code:

my $output = &load_template ('link.html', {


Like the following:

Code:

my $output = &load_template ($template, {


Then create another template file called link2.html.

NOW, if you want to check the CategoryID field with the actual category name, then you will have to use the following codes:

Code:

my $catname = &Links::DB_Utils::get_category_name($rec->{CategoryID});
if ($catname eq 'Something') {
$template = "link2.html";
}
else {
$template = "link.html";
}


2) Hack the sub build_category_pages in the nph-build.cgi file

Replace the following codes:

Code:

$OUT{links} .= &site_html_link ($tmp);


with the following codes:

Code:

if ($OUT{category_name} eq 'Something') {
$OUT{links2} .= &site_html_link2 ($tmp);
}
else {
$OUT{links} .= &site_html_link ($tmp);
}


Note: There are a bunch of these codes in the subroutine, so you need to edit all of them.

You will also need to create another subroutine in the HTML_Templates.pm file called sub site_html_link2 and this subroutine should load link2.html.

Then in your category.html template file, you need to add the following codes:

Code:

<%if links2%>
<%links2%>
<%endif%>


Hope these suggestions help.

Regards,

Eliot Lee

Subject Author Views Date
Thread Template2 - Different Category Templates Mod CyberLuke 10644 Oct 2, 2000, 11:35 AM
Thread Re: Template2 - Different Category Templates Mod
pugdog 10489 Oct 2, 2000, 11:51 AM
Thread Re: Template2 - Different Category Templates Mod
CyberLuke 10477 Oct 2, 2000, 12:51 PM
Thread Re: Template2 - Different Category Templates Mod
lparry 10473 Oct 2, 2000, 10:08 PM
Thread Re: Template2 - Different Category Templates Mod
pugdog 10471 Oct 3, 2000, 9:41 AM
Thread Re: Template2 - Different Category Templates Mod
RWhite 10381 Oct 10, 2000, 8:22 PM
Thread Re: Template2 - Different Category Templates Mod
Stealth 10407 Oct 10, 2000, 8:42 PM
Thread Re: Template2 - Different Category Templates Mod
RWhite 10382 Oct 10, 2000, 9:20 PM
Thread Re: Template2 - Different Category Templates Mod
Stealth 10381 Oct 10, 2000, 9:29 PM
Thread Re: Template2 - Different Category Templates Mod
RWhite 10388 Oct 10, 2000, 9:38 PM
Post Re: Template2 - Different Category Templates Mod
Stealth 10373 Oct 10, 2000, 9:39 PM
Thread Re: Template2 - Different Category Templates Mod
RWhite 10351 Oct 11, 2000, 8:57 AM
Thread Re: Template2 - Different Category Templates Mod
pugdog 10367 Oct 11, 2000, 9:53 AM
Post Re: Template2 - Different Category Templates Mod
RWhite 10342 Oct 11, 2000, 11:46 AM
Thread Re: Template2 - Different Category Templates Mod
campos 10333 Oct 13, 2000, 9:32 AM
Thread Re: Template2 - Different Category Templates Mod
pugdog 10341 Oct 13, 2000, 9:41 AM
Thread Re: Template2 - Different Category Templates Mod
campos 10319 Oct 13, 2000, 10:28 AM
Post Re: Template2 - Different Category Templates Mod
campos 10315 Oct 13, 2000, 10:30 AM
Post Re: Template2 - Different Category Templates Mod
pugdog 10331 Oct 13, 2000, 10:42 AM