Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: Possible bug in Category Template

Quote Reply
Re: Possible bug in Category Template In reply to
Alex/Anyone,

Firstly - thank you for the solution. Here is the solution for anyone else that wants a different category for their parent and wants to use category.html for children categories.

Code:
sub _template_set {
# -------------------------------------------------------------------
# Returns the template set for a given category id.
#
my ($self, $id) = @_;
return unless ($id);

# If this category has a template set, use it.
my $cat_info = $self->get($id, 'HASH', 'Category_Template');
if ($cat_info->{Category_Template}) {
return $cat_info->{Category_Template};
}

# Otherwise look at it's parents.
# my $template = '';
# my $parents = $self->parents ($id);
# foreach my $parent (@$parents) {
# my $cat_info = $self->get($parent, 'HASH', 'Category_Template');
# if ($cat_info->{Category_Template}) {
# $template = $cat_info->{Category_Template};
# last;
# }
# }
# return $template;
}
Thanks

Subject Author Views Date
Thread Possible bug in Category Template jeffb 4780 Aug 22, 2001, 5:18 PM
Thread Re: Possible bug in Category Template
Alex 4747 Aug 22, 2001, 5:28 PM
Thread Re: Possible bug in Category Template
jeffb 4735 Aug 23, 2001, 10:00 AM
Thread Re: Possible bug in Category Template
Alex 4719 Aug 23, 2001, 11:33 AM
Post Re: Possible bug in Category Template
jeffb 4719 Aug 23, 2001, 11:50 AM
Thread Re: [Alex] Possible bug in Category Template
jeffb 4606 May 1, 2002, 7:18 AM
Post Post deleted by Paul
Paul 4617 May 1, 2002, 7:40 AM
Thread Re: [Alex] Possible bug in Category Template
webmaster33 4614 May 2, 2002, 4:58 AM
Thread Re: [webmaster33] Possible bug in Category Template
jeffb 4600 May 7, 2002, 1:07 AM
Thread Re: [jeffb] Possible bug in Category Template
Alex 4546 May 11, 2002, 9:42 AM
Thread Re: [Alex] Possible bug in Category Template
jeffb 4535 May 12, 2002, 4:56 PM
Thread Re: [jeffb] Possible bug in Category Template
Alex 4531 May 14, 2002, 5:07 PM
Thread Re: [Alex] Possible bug in Category Template
jeffb 4549 May 14, 2002, 5:46 PM
Post Re: [jeffb] Possible bug in Category Template
Alex 4521 May 14, 2002, 6:02 PM
Thread Re: [Alex] Possible bug in Category Template
SeanP 4490 May 14, 2002, 8:58 PM
Post Re: [SeanP] Possible bug in Category Template
jeffb 4506 May 15, 2002, 5:23 PM