I'm currently using the following code in site_html_templates.pl to load a different template for a few special top level categories:
# --------------------------------------------------------
# This rountine will build a page based for the current category.
my $template;
# Set the appropriate template file to load
if ($category_name =~ "Category_1_Name") {
$template = "cat1.html"; }
elsif ($category_name =~ "Category_2_Name") {
$template = "cat2.html"; }
else { $template = "category.html"; }However, I now need to use a different template for a sub category of special category 1 above, and I cannot figure out how to do this.
I need Category_1_Name to use cat1.html as a template,
Category_1_Name/Subcategories to use cat1sub.html as a template,
and the rest of the categories to use the standard category.html template.
Any pointers? I don't know how to distinguish the category's subcategories from the category itself using the above code since they also match the check.
Thanks very much.
P.S. The original mod above was also from these forums.
Code:
sub site_html_category { # --------------------------------------------------------
# This rountine will build a page based for the current category.
my $template;
# Set the appropriate template file to load
if ($category_name =~ "Category_1_Name") {
$template = "cat1.html"; }
elsif ($category_name =~ "Category_2_Name") {
$template = "cat2.html"; }
else { $template = "category.html"; }
I need Category_1_Name to use cat1.html as a template,
Category_1_Name/Subcategories to use cat1sub.html as a template,
and the rest of the categories to use the standard category.html template.
Any pointers? I don't know how to distinguish the category's subcategories from the category itself using the above code since they also match the check.
Thanks very much.
P.S. The original mod above was also from these forums.