Gossamer Forum
Home : Products : Gossamer Links : Pre Sales :

Re: Different category template for different category

Quote Reply
Re: Different category template for different category In reply to
I'm really sorry. I distinctly remember writing this code, but now I can't find it in our source control, our in any existing version. Ugh!

Please replace site_html_category in Links/SiteHTML.pm with:

Code:
sub site_html_category {
# --------------------------------------------------------
# Return parsed category page.
#
my $tags = shift;

$tags->{build_links_per_page} = $CFG->{build_links_per_page};
($tags->{category_first}) = $tags->{'category_name'} =~ m,/?([^/]+)$,;

# Find the proper template.
my $template = 'category.html';
my $cat_db = $DB->table('Category');
if ($cat_db->cols->{'CategoryTemplate'}) {
if ($tags->{CategoryTemplate}) {
$template = $tags->{CategoryTemplate};
}
else {
my $parents = $cat_db->parents ($tags->{ID});
foreach my $parent (@$parents) {
my $cat_info = $cat_db->get($parent);
if ($cat_info->{CategoryTemplate}) {
$template = $cat_info->{CategoryTemplate};
last;
}
}
}
}
my $output = Links::load_template ($template, $tags, { dynamic => 1 });
return $output;
}
and it should work as expected. Again, I'm sorry about the mixup.

Cheers,

Alex

--
Gossamer Threads Inc.
Subject Author Views Date
Thread Different category template for different category kelvin74 18711 Feb 20, 2001, 6:35 AM
Post Re: Different category template for different category
Stealth 18237 Feb 20, 2001, 8:26 AM
Thread Re: Different category template for different category
Alex 18287 Feb 20, 2001, 10:30 AM
Thread Re: Different category template for different category
aculiuc 18344 Feb 23, 2001, 7:49 AM
Thread Re: Different category template for different category
Alex 18206 Feb 23, 2001, 9:26 PM
Thread Re: Different category template for different category
aculiuc 18177 Mar 2, 2001, 9:16 AM
Thread Re: Different category template for different category
Alex 18198 Mar 2, 2001, 9:22 AM
Thread Re: Different category template for different category
funodie 18059 Mar 26, 2001, 10:05 AM
Thread Re: Different category template for different category
Alex 18048 Mar 28, 2001, 12:31 PM
Thread Re: Different category template for different category
funodie 18075 Mar 28, 2001, 2:15 PM
Post different layout for 'subcategory-lists'
der_geizige 18027 Mar 28, 2001, 11:53 PM
Thread Re: Different category template for different category
Alex 18097 Mar 29, 2001, 12:11 PM
Thread Re: Different category template for different category
carfac 17980 Apr 2, 2001, 11:02 AM
Thread Re: Different category template for different category
Alex 17911 Apr 2, 2001, 11:47 AM
Thread Re: Different category template for different category
carfac 17940 Apr 2, 2001, 1:08 PM
Thread Re: Different category template for different category
Alex 17790 Apr 6, 2001, 8:22 AM
Thread Re: Different category template for different category
Evoir 17683 May 20, 2001, 9:16 AM
Thread Re: Different category template for different category
pugdog 17637 May 20, 2001, 9:33 AM
Thread Re: Different category template for different category
Evoir 17671 May 20, 2001, 10:22 AM
Thread Re: Different category template for different category
Stealth 17597 May 20, 2001, 3:39 PM
Thread Re: Different category template for different category
Evoir 17658 May 20, 2001, 4:40 PM
Thread Re: Different category template for different category
pugdog 17617 May 20, 2001, 5:55 PM
Thread Re: Different category template for different category
Evoir 17616 May 20, 2001, 6:34 PM
Post Re: Different category template for different category
pugdog 17626 May 20, 2001, 7:43 PM
Thread Re: Different category template for different category
BeaverheadRiver 5858 May 21, 2001, 1:14 PM
Thread Re: Different category template for different category
Evoir 5882 May 21, 2001, 2:28 PM
Post Re: Different category template for different category
BeaverheadRiver 5780 May 22, 2001, 5:20 AM
Thread Re: Different category template for different category
Alex 5897 May 22, 2001, 12:00 PM
Post Re: Different category template for different category
Evoir 5880 May 22, 2001, 10:10 PM
Thread Re: Different category template for different category
Evoir 5429 Jul 26, 2001, 10:17 AM
Post Re: Different category template for different category
pugdog 5460 Jul 26, 2001, 11:28 AM
Post Re: [Alex] Different category template for different category
aprillougheed 5021 Mar 16, 2002, 5:43 AM
Post Re: Different category template for different category
PelsLvr 5440 Jul 23, 2001, 12:05 PM
Post Re: Different category template for different category
msdq 17738 Apr 25, 2001, 1:25 PM