-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
I want to implement Twitter-style pagination but to stop and after N pages, replacing the scroll by a "show more" link that will then start again the scrolling pagination. I'm using the chunk feature but it is not working for me. It keeps the scrolling pagination just like the chunk feature is turned off. This is my code:
view.py:
def dashboard(request):
template = 'articles/dashboard.html'
page_template = 'articles/dashboard_page.html'
if request.is_ajax():
template = page_template
context = {
'section':'dashboard',
'entries': Article.objects.all().order_by('-publish_date'),
'page_template': page_template,
}
return render(request, template, context)
dashboard.html:
{% include page_template %}
{% block js %}
{{ block.super }}
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="{% static 'js/el_pagination/el-pagination.js' %}"></script>
<script>
$.endlessPaginate({
paginateOnScroll: true,
paginateOnScrollChunkSize: 20
});
</script>
dashboard_page.html:
{% load el_pagination_tags %}
{% paginate entries %}
{%for article in entries%}
...
{%endfor%}
{% show_more "mais" "a carregar..." %}
I'm el-pagination version 3.3.0 with Django 3.6.7
davidADSP
Metadata
Metadata
Assignees
Labels
No labels