Comments (9)
Hi, I had the same problem it is caused by show_more it creates div inside table.
I've managed to repair it but I hate this solution cause it interfences in library source (in any update of library solution will stop working)
I've changed show_more.html
from:
<div class="endless_container"> <a class="endless_more" href="{{ path }}{{ querystring }}" rel="{{ querystring_key }}">{% if label %}{{ label }}{% else %}{% trans "more" %}{% endif %}</a> <div class="endless_loading" style="display: none;">{{ loading|safe }}</div> </div>
to :
<tr class="endless_container"><td> <a class="endless_more" href="{{ path }}{{ querystring }}" rel="{{ querystring_key }}">{% if label %}{{ label }}{% else %}{% trans "more" %}{% endif %}</a></td> <td class="endless_loading" style="display: none;">{{ loading|safe }}</td> </tr>
and it works perfectly :)
just need to find this python lib directory in virtualenv it'll be myEnv/lib/pythonx.x/site-packages/endless_pagination/templates/endless/show_more.html
from django-endless-pagination.
Thanks Greg, that was extremely helpful!
If your apps templates load before endless's you can just add your modified template to your app in the directory <your app>/endless/show_more.html
.
from django-endless-pagination.
Hi Anders, I am having the same problem and neither solution works. Using tr and td stop the entire pagination from working. Any other solutions to stop this from happening?
from django-endless-pagination.
Anders Good point thank you too!!! I totally forgot about this I'm using this solution for userena to customize my templates but didn't think to use it for endless :D :),
Konrad take a look at my example http://pastebin.com/fj5GCmRq
and here you can see it working:
http://exerceo.pl/food/
from django-endless-pagination.
Hi @konrad1234,
In my project created the template <my project>/<my app>/templates/endless/show_more.html
and this overrides the default template:
{% load i18n %}
<tr class="endless_container">
<td> <a class="endless_more" href="{{ path }}{{ querystring }}" rel="{{ querystring_key }}">{% if label %}
{{ label }}
{% else %}
{% trans "more" %}
{% endif %}</a>
</td>
<td class="endless_loading" style="display: none;">
{{ loading|safe }}
</td>
</tr>
Then in my main template which uses endless I wrap it in a <table>
.
from django-endless-pagination.
Thanks Greg and Anders! I'm not sure if we actually had the same problem but I used Greg's example to figure it out. I believe my problem was associated with not implementing the page_template system properly.
from django-endless-pagination.
Hi, thank you very much for this comments, they help me a lot.
I had a little problem with the new "show_more" template, if I scroll down, it doesn't stop of reload contents even when they are repeated. In order to avoid this, just add {% if querystring %} as follow (we can see it in the original file):
{% load i18n %}
{% if querystring %}
<tr class="endless_container">
<td>
<a class="endless_more" href="{{ path }}{{ querystring }}" rel="{{ querystring_key }}">
{% if label %}
{{ label }}
{% else %}
{% trans "more" %}
{% endif %}
</a>
</td>
<td class="endless_loading" style="display: none;">
{{ loading|safe }}
</td>
</tr>
{% endif %}
Best regards
from django-endless-pagination.
If you want to overwrite the:
your_venv_name/lib/pythonx.x/site-packages/el_pagination/templates/el_pagination/show_more.html
or if you use el_pagination like me:
your_venv_name/lib/pythonx.x/site-packages/endless_pagination/templates/endless/show_more.html
Then palce your custom show_more.html template in your app tempalte folder:
your_app_name/templates/el_pagination/show_more.html
Make sure that your_app_name
is above the endless pagination package in the INSTALLED_APPS to overwrite the original:
INSTALLED_APPS = [
'...',
'...',
'your_app_name',
'el_pagination',
]
and
APP_DIRS are set to true:
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(PROJECT_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
from django-endless-pagination.
Previous versions didn't seem to work. Working:
{% load i18n %}
{% if querystring %}
<tr class="endless_container">
<td>
<a class="endless_more{% if class_name %} {{ class_name }}{% endif %}" href="{{ path }}{{ querystring }}"
data-el-querystring-key="{{ querystring_key }}">
{% if label %}
{{ label|safe }}
{% else %}
{% trans "more" %}
{% endif %}
</a>
<div class="endless_loading" style="display: none;">{{ loading|safe }}</div>
</td>
</tr>
{% endif %}
from django-endless-pagination.
Related Issues (20)
- Buggy PAGINATION with order by id DESC HOT 1
- How to avoid removing “page” parameter from URI? HOT 1
- not load css div HOT 1
- {{ pages.previous }} on page 2 doesn't have ?page=1 in URL
- Render with Context, instead of RequestContext
- A global setting to decide the number of elements in one page HOT 1
- Django Paginator API should be respected
- [SQL optimization] Use keyset pagination (a.k.a. seek method)
- Adding text at the end of pagination
- Paginate template tag not thread safe
- This project is supported? development will be? HOT 10
- Warning in loader.py in Django 1.8 HOT 7
- -1 -2 -3 -4 Page URLS HOT 1
- When new objects are loaded, it does not appear in the source page.
- Is there any way to get counter on endless pagination items? HOT 1
- RemovedInDjango19Warning HOT 6
- ABANDONED APPLICATION: PLEASE DO NOT USE [from django 1.9] HOT 3
- ImportError: No module named 'django.utils.importlib' HOT 2
- How to use it with Masonry?
- ModuleNotFoundError: No module named 'django.utils.importlib' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-endless-pagination.