Here is my template code for my queryset request:
{% block comments %}
{% load el_pagination_tags %}
{% paginate 10 comment_list %}
{% for i in comment_list %}
<div class='comment_div'>
<div class="left_comment_div">
<p>{{ i.comment_text }}</p>
</div>
</div>
{% include 'comment/comments.html' with comment_list=i.replies.all %}
</div>
{% endfor %}
{% show_more %}
{% endblock %}
I am using django el pagination to implement ajax pagination. On the third line, you see that I initially upload 10 comments. With this package, an element appears {% show_more %} that you can add , which, when clicked, will load the rest of the comments.
However, this element {% show_more %}disappears for some reason when I add {% include 'comment/comments.html' with comment_list=i.replies.all %}. For context, this tag includeshows the responses for the current comment in a for loop.
Does anyone know why this tag affects an element {% show_more %}?
: show_more Github Source
el_pagination_tags.py
if page.has_next():
print('Has next')
request = context['request']
page_number = page.next_page_number()
querystring_key = data['querystring_key']
querystring = utils.get_querystring_for_page(
request, page_number, querystring_key,
default_number=data['default_number'])
return {
'label': label,
'loading': loading,
'class_name': class_name,
'path': iri_to_uri(data['override_path'] or request.path),
'querystring': querystring,
'querystring_key': querystring_key,
'request': request,
}
print('No next')
return {}
- , , , , , ? .