Hi guys,
recently i need to show only descendants categories of given category in template (i talk about oscar.apps.catalogue.models.Category). I've written my own template tag `category_tree_extended`, mostly copied from oscar's category_tree tag, with following syntax:
{% category_tree_extended [depth=n] [parent=<parent_category>] as categories %}
But i think, that it will be nice, if oscar's category_tree tag will have such functionality.
I have the code and can make a pull request.
Will it be useful?
Here are some examples:
suppose we have these categories:
Vegetable
Tomato
Сucumber
Fruit
Сitrus
Orange
Lemon
Banana
Now we can do in template:
{% category_tree parent=Fruit as tree_categories %}
tree_categories will have following categories:
Сitrus
Orange
Lemon
Banana
{% category_tree depth=1 parent=Fruit as tree_categories %}
tree_categories will have following categories:
{% category_tree as tree_categories %}
tree_categories will have following categories:
Vegetable
Tomato
Сucumber
Fruit
Сitrus
Orange
Lemon
Banana