So you want to use one template for everything except for the leaf (in tree terminology) categories?
So for something like:
+-B
+-C
| +-D
| | --E
| --F
--G
--HA, C, D, G would use one template and B, E, F, H would use another?
If that's the case, that that would be relatively easy to fix by writing a global that sees if the current category has any children. Something like:
my $cat_id = shift;
return $DB->table('Category')->count({ FatherID => $cat_id });
}Then in the templates, do something like:
<%if not children%><%include child_category.html%><%endparse%><%endif%>
Adrian
So for something like:
Code:
A +-B
+-C
| +-D
| | --E
| --F
--G
--H
If that's the case, that that would be relatively easy to fix by writing a global that sees if the current category has any children. Something like:
Code:
sub { my $cat_id = shift;
return $DB->table('Category')->count({ FatherID => $cat_id });
}
Code:
<%set children = children_count($ID)%> <%if not children%><%include child_category.html%><%endparse%><%endif%>
Adrian