Hello,
I want to implement breadcrumb navigation for a store with a couple of
thousand products, all belonging to a number of categories.
As the product category association is m:n, the navbar is currently
implemented in the product template like this:
{% block navbar %}
<li class="first"><a href="{{ shop_base }}/">{% trans "Home" %}</a></
li>
{% for name, url in product.category.all.0.get_url_name %}
<li><a href="{{ url }}">{{ name }}</a></li>
{% endfor %}
<li>{{ product.translated_name }}</li>
{% endblock %}
This means, if there is a product, which belongs to different
categories, and a user finds the product while browsing through
Category X, the navbar of the product page could still link to
Category Y, although the user has never looked at that category. I
find this rather confusing and would prefer displaying the category in
which the user was browsing before.
At the moment I have two different ideas how to solve this:
1) Store the last viewed category in the session.
2) Have an additional /category/XYZ/product/ABC URI for the products
and pass the category to the view.
The first option seems somewhat hack-ish to me, so I would prefer the
latter. However, i am not quite sure, how to do that without modifying
satchmo's code. Can anyone tell me how to do it or show me a better
way?
- Martin
--
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.