GithubHelp home page GithubHelp logo

pico-pagination's Issues

can't be combined with other plugins and dynamic content (like search!)

While I had a few issues getting pagination working, I got that done. As far as my setup and testing goes, seems to be working for now.

Now I have a new problem. I've just implemented the Search plugin. Both seem to be working, as long as they are separated. The issue is, I don't see how to combine the two properly. (Maybe it's just me. It's past 4 in the morning).

The issue is, that Pagination filters ahead of time from all pages. Always! I can't just throw the search result in a folder and tell the pagination plugin to go from there. The search results are being created dynamically.

The Search plugin before worked directly with the pages array. Since this caused issues with other plugins as well, they actually noticed the issue, rewrote it in 2020 and now provide a FILTER. So, the search plugin can now be applied to any array/pages that are being thrown at it. That is a great way of handling data.

The issue is, there is no sense in applying the search AFTER pagination. It should be search filter first and pagination of the resulting pages afterwards. Applying pagination as a filter as well would solve the problem.

renaming file and class to able to load

Hi,
I tried to use it with Pico 2.1 and foound some installation issues:

[Sat Apr 01 09:45:39.898139 2023] [php7:error] [pid 837] [client 127.0.0.1:38800] PHP Fatal error: Uncaught RuntimeException: Unable to load plugin 'Pico-Pagination' from 'Pico-Pagination/Pico-Pagination.php': File not found in /var/www/html...

My solution was:

mv 10-Pagination.php Pico-Pagination.php

Next problem:

[Sat Apr 01 10:00:39.492419 2023] [php7:error] [pid 835] [client 127.0.0.1:41730] PHP Fatal error: Uncaught RuntimeException: Unable to load plugin 'Pico-Pagination' from 'Pico-Pagination/Pico-Pagination.php': Plugin class not found in /var/www/html/...

My solution was:

mv Pico-Pagination PicoPagination
mv Pico-Pagination.php PicoPagination.php
sed -e 's/class Pagination extends/class PicoPagination extends/' PicoPagination.php

Link is not working: I always get back to index page

Hi!

I try to use you awesome plugin. Since it seems to work with so many people, the failure lies probably on my side.

My problem: I get back to the index page, when I click on a "older/newer" link.

I include the pagination on a subpage blog, therefore I changed the pagination_page_indicator to blog in my config.ymlfile. The link is correct: http://myurl.com/blog/2.

But when I click on the link I get directed to http://myurl.com. How can I avoid this?

Pagination w/ unexpected order / empty pages

Hi,
I'm tinkering with pico CMS. I installed the blank blog theme and then tried my hand on this plugin.
I inserted the template code into the index.html of that plugin
I am running into the following issue where the pagination doesn't do what I would expect. I have created 7 bogus blog pages in content/blog/. If I now limit pagination to 3, I receive an order 3-2-2 instead of 3-3-1 as I would expect. Limit 2 yields 2-2-1-2 and limit 1 delivers a bizarre empty page 6 when pages 7,8 still have content.

Ok, to give a fair description, I now pasted the template from your Readme into the default template and found sth that should help. The odd number is the Welcome page. It appears that your plugin counts it in while the blog theme then only lists the pages that have a date.

Kind regards,
Matthias

paged_pages for pagination_sub_page

If pagination_sub_page is set to true shouldn't paged_pages not only return pages from pagination_page_indicator sub folder?
Otherwise I don't get the sense for this option.

Many pages

How not to display all pages when there are many?
Now: 1 2 3 4 5 6 7 8 9
Necessary: 1 2 3 ... 8 9

Define multiple sub pages for pagination?

I've defined:
$config['pagination_sub_page'] = true;
$config['pagination_page_indicator'] = "blog";
for posts in my /blog sub-folder, but I'd like to define another subfolder /music, for example, and be able to iterate through those for pagination. Would I need to create another array ex:paged_pages_2 to accomplish this or is there another method?

Thanks for all your work on this plugin!

Pagination is not working properly

Hi Andrew,

First I wanted to thank you for this plugin; I followed your instructions to set up the plugin and Pico to use it.

I have one issue though; by the time I reach the post limit for one page and the plugin kicks in, if I press next page I will the same page - e.g. all the posts listing again as for the first page instead of the one post, following the order and the age criteria.

Any ideas?

Thank you,

Razvan

Question: What if your 'blog' page isn't the index/front page?

I have my Pico theme set to show a static front page (on the index) and then have my list of blog entries generating on another page (/blog). This is all done through the index.html file using the twig language and if statements.

The issue I am running into, using this pagination plugin, is that when I click the 'next' link it ends up sending me to /page/2 (which is correct) but doesn't display the list containing the next set of blog entries. What get's displayed is the front page/index page.

Any thoughts?

I know the plugin works great as I've tried it on the default pico theme but I am wondering if you might have any thoughts or suggestions.

Article order problems when using sub folders

There seems to be a problem sorting articles when using sub folders. The pages are not all sorted by date but they are grouped by sub folder (with one confusing exception).

My setup:

artikel.twig

    <div id="main" role="main">
        <div class="container">
            {{ content }}
            <h1 class="postlist-header">Alle Artikel auf Freude am Film:</h1>
            {% for page in paged_pages|sort_by("time")|reverse if not page.hidden %}
                <div class="post">
                    <h2><a href="{{ page.url }}">{{ page.title }}</a></h2>
                    <p class="date">{{ page.date_formatted }} {% if "filmkritik" in page.url %} | Filmkritik {% endif %} {% if "werkschau" in page.url %} | Werkschau {% endif %} {% if "kurzkritiken" in page.url %} | Kurzkritiken {% endif %}</p> 
                    <p class="excerpt">{{ page.description }}</p>
                </div>
            {% endfor %}
            <div class="pagination">
                {% if page_number > 1 %}<a href="{{ base_url }}/{{ page_indicator }}/{{ page_number - 1 }}" class="button previous">Neuere Einträge</a>{% endif %}
                    <div class="pages">
                        {% for page_num in 1..total_pages %}
                        <a href="{{ base_url }}/{{ page_indicator }}/{{ page_num }}"{% if page_num == page_number %} class="active"{% endif %}>{{ page_num }}</a>
                        {% endfor %}
                    </div>
                {% if page_number < total_pages %} <a href="{{ base_url }}/{{ page_indicator }}/{{ page_number + 1 }}" class="button next">Ältere Einträge</a>{% endif %}
            </div>
        </div>
    </div>

config.yml:

pagination_limit: 10
pagination_next_text: "Weiter >"
pagination_prev_txt: "< Zurück"
pagination_sub_page: true
pagination_page_indicator: artikel

Folder structure:

/artikel (index [using artikel.twig] and 1 other page)
/artikel/filmkritik (9 pages)
/artikel/kurzkritiken (1 page)
/artikel/werkschau (1 page)

Expected result

Sorting of all pages by date, mixing all the folders

filmkritik 9
filmkritik 8
werkschau 1
filmkritik 7
filmkritik 6
filmkritik 5
kurzkritiken 1 
filmkritik 4
filmkritik 3
artikel 1
[new page]
filmkritik 2
filmkritik 1

Actual result

The pages seem to be grouped by folder, except the one page from "kurzkritiken"

filmkritik 9
filmkritik 8
filmkritik 7
filmkritik 6
filmkritik 5
kurzkritiken 1 
filmkritik 4
filmkritik 3
filmkritik 2
filmkritik 1
[new page]
werkschau 1
artikel 1

Previous post and Next post links in post individual page

Is it possible, using the plugin as is, to have two links for the previous and next posts in the individual post page?
Something like this below the post's content:
| << Previous post title | Next post title >> |

I've done it like this but the order is all messed up. Seems to be sorted alphabetically instead of sorted by date:

{% if prev_page.title %}
  <span class="prev-post">
    <a href="{{ prev_page.url }}" rel="prev">{{ prev_page.title }}</a>
  </span>
{% endif %}

{% if next_page.title %}
  <span class="next-post">
    <a href="{{ next_page.url }}" rel="next">{{ next_page.title }}</a>
  </span>
{% endif %}

Thanks in advance for your help.

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.