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 15784 Feb 20, 2001, 6:35 AM
Post Re: Different category template for different category
Stealth 15367 Feb 20, 2001, 8:26 AM
Thread Re: Different category template for different category
Alex 15401 Feb 20, 2001, 10:30 AM
Thread Re: Different category template for different category
aculiuc 15473 Feb 23, 2001, 7:49 AM
Thread Re: Different category template for different category
Alex 15337 Feb 23, 2001, 9:26 PM
Thread Re: Different category template for different category
aculiuc 15308 Mar 2, 2001, 9:16 AM
Thread Re: Different category template for different category
Alex 15327 Mar 2, 2001, 9:22 AM
Thread Re: Different category template for different category
funodie 15189 Mar 26, 2001, 10:05 AM
Thread Re: Different category template for different category
Alex 15180 Mar 28, 2001, 12:31 PM
Thread Re: Different category template for different category
funodie 15190 Mar 28, 2001, 2:15 PM
Post different layout for 'subcategory-lists'
der_geizige 15158 Mar 28, 2001, 11:53 PM
Thread Re: Different category template for different category
Alex 15215 Mar 29, 2001, 12:11 PM
Thread Re: Different category template for different category
carfac 15111 Apr 2, 2001, 11:02 AM
Thread Re: Different category template for different category
Alex 15040 Apr 2, 2001, 11:47 AM
Thread Re: Different category template for different category
carfac 15067 Apr 2, 2001, 1:08 PM
Thread Re: Different category template for different category
Alex 14921 Apr 6, 2001, 8:22 AM
Thread Re: Different category template for different category
Evoir 14788 May 20, 2001, 9:16 AM
Thread Re: Different category template for different category
pugdog 14767 May 20, 2001, 9:33 AM
Thread Re: Different category template for different category
Evoir 14801 May 20, 2001, 10:22 AM
Thread Re: Different category template for different category
Stealth 14729 May 20, 2001, 3:39 PM
Thread Re: Different category template for different category
Evoir 14781 May 20, 2001, 4:40 PM
Thread Re: Different category template for different category
pugdog 14742 May 20, 2001, 5:55 PM
Thread Re: Different category template for different category
Evoir 14744 May 20, 2001, 6:34 PM
Post Re: Different category template for different category
pugdog 14757 May 20, 2001, 7:43 PM
Thread Re: Different category template for different category
BeaverheadRiver 4853 May 21, 2001, 1:14 PM
Thread Re: Different category template for different category
Evoir 4868 May 21, 2001, 2:28 PM
Post Re: Different category template for different category
BeaverheadRiver 4787 May 22, 2001, 5:20 AM
Thread Re: Different category template for different category
Alex 4890 May 22, 2001, 12:00 PM
Post Re: Different category template for different category
Evoir 4886 May 22, 2001, 10:10 PM
Thread Re: Different category template for different category
Evoir 4428 Jul 26, 2001, 10:17 AM
Post Re: Different category template for different category
pugdog 4464 Jul 26, 2001, 11:28 AM
Post Re: [Alex] Different category template for different category
aprillougheed 4027 Mar 16, 2002, 5:43 AM
Post Re: Different category template for different category
PelsLvr 4443 Jul 23, 2001, 12:05 PM
Post Re: Different category template for different category
msdq 14869 Apr 25, 2001, 1:25 PM