Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add hashtag to next/prev links

  • Loading branch information...
commit 1d3f1e02ad947bc6c25f1ecfc27fbaa7a6629090 1 parent a92e388
Carl Meyer carljm authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 pagination/templates/pagination/pagination.html
4 pagination/templates/pagination/pagination.html
View
@@ -2,7 +2,7 @@
{% load i18n %}
<div class="pagination">
{% if page_obj.has_previous %}
- <a href="?page={{ page_obj.previous_page_number }}{{ getvars }}" class="prev">&lsaquo;&lsaquo; {% trans "previous" %}</a>
+ <a href="?page={{ page_obj.previous_page_number }}{{ getvars }}{{ hashtag }}" class="prev">&lsaquo;&lsaquo; {% trans "previous" %}</a>
{% else %}
<span class="disabled prev">&lsaquo;&lsaquo; {% trans "previous" %}</span>
{% endif %}
@@ -18,7 +18,7 @@
{% endif %}
{% endfor %}
{% if page_obj.has_next %}
- <a href="?page={{ page_obj.next_page_number }}{{ getvars }}" class="next">{% trans "next" %} &rsaquo;&rsaquo;</a>
+ <a href="?page={{ page_obj.next_page_number }}{{ getvars }}{{ hashtag }}" class="next">{% trans "next" %} &rsaquo;&rsaquo;</a>
{% else %}
<span class="disabled next">{% trans "next" %} &rsaquo;&rsaquo;</span>
{% endif %}

1 comment on commit 1d3f1e0

ivantchomgue

Hello,
I find very interesting to have a hashtag variable in your pagination template. But the problem is how do we set this variable when using {% paginate %} tag in our own template. I try out with:

{% with hashtag="#id_to_go" %}
{% paginate %}
{% endwith %}

but it doesn't change the default hashtag value which is set to an empty string. How do I use my own hastag without change the built-in tag function ?

Please sign in to comment.
Something went wrong with that request. Please try again.