diff --git a/oscar/templates/oscar/catalogue/detail.html b/oscar/templates/oscar/catalogue/detail.html
index 626565eacfc..35f116c70a2 100644
--- a/oscar/templates/oscar/catalogue/detail.html
+++ b/oscar/templates/oscar/catalogue/detail.html
@@ -29,6 +29,15 @@
{% endfor %}
{{ product.title }}
+
+ {% get_back_button as backbutton %}
+ {% if backbutton %}
+
+
+ {{ backbutton.title }}
+
+
+ {% endif %}
{% endwith %}
{% endblock %}
@@ -37,16 +46,8 @@
{% endblock header %}
{% block content %}
-{% get_back_button as backbutton %}
- {% if backbutton %}
-
-
- {{ backbutton.title }}
-
- {% endif %}
-
{% comment %}
This is a but clunky here. Better to have some kind of JS-driven dashboard menu that
pops out when clicked. A bit like the Django-Debug-Toolbar button
diff --git a/oscar/templatetags/history_tags.py b/oscar/templatetags/history_tags.py
index 857be6a799d..9d4db30edf1 100644
--- a/oscar/templatetags/history_tags.py
+++ b/oscar/templatetags/history_tags.py
@@ -37,9 +37,11 @@ def recently_viewed_products(context):
@register.assignment_tag(takes_context=True)
def get_back_button(context):
- """Show back button, custom title available for different urls, for
+ """
+ Show back button, custom title available for different urls, for
example 'Back to search results', no back button if user came from other
- site"""
+ site
+ """
request = context.get('request', None)
if not request:
raise Exception('Cannot get request from context')
@@ -65,6 +67,7 @@ def get_back_button(context):
except Resolver404:
return None
+ # This dict can be extended to link back to other browsing pages
titles = {
'search:search': _('Back to search results'),
}