The variable categorylist is coming from the category_index view, which you can find in "apps/product/views/__init__.py". This view is mapped to the URL "/category/". The point of this view/template is to display all active categories on the site. To get the categories that are children of the currently active category, you should have a look at some of the category-related template tags, e.g. category_tree and category_list. You can find those at "apps/satchmo_store/shop/templatetags/satchmo_category.py".
Hope that helps, --Stuart On Tue, Aug 10, 2010 at 2:30 PM, zayatzz <[email protected]> wrote: > Hi. > > Im just beginning to learn satchmo and in my first project im trying > to show categories not in a tree view but by their images. > when you are on front page you are supposed to see the images of main > categories and not their subcategories. when you click on category on > front page you are supposed to see the children of currenty category. > > I checked existing templates and info that is available on wiki / in > docs. and i did not find much info. going through code i found that > categories are beeing put into context and i can loop through that. > > what i cant see is easy way to get categories of currently active > level, or categories that are children of currently active category. > Is there a way to do that? If i read the code correctly then, > all_categories = Category.objects.by_site() in context gives out ALL > categories, meaning i would have to check in template if the category > is active or not. Is that true? is the id of current category > available in context somehow or do i have to check it against request > url? > > What is this categoryList ({% for category in categorylist %}) in > category_index.html? > > Alan > > -- > You received this message because you are subscribed to the Google Groups > "Satchmo users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/satchmo-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Satchmo users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en.
