Git Product home page Git Product logo

Comments (9)

greg4fun avatar greg4fun commented on July 2, 2024

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.

macdhuibh avatar macdhuibh commented on July 2, 2024

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.

konrad1234 avatar konrad1234 commented on July 2, 2024

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.

greg4fun avatar greg4fun commented on July 2, 2024

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.

macdhuibh avatar macdhuibh commented on July 2, 2024

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.

konrad1234 avatar konrad1234 commented on July 2, 2024

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.

hecrogon avatar hecrogon commented on July 2, 2024

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.

jturi avatar jturi commented on July 2, 2024

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.

JediKnightChan avatar JediKnightChan commented on July 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.