-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"pagination" variable in "pagination.html.twig" doesn't containt the right data. #31
Comments
I made a small twig pagination that works with the Grav Collection Methods: Example:
|
This problem takes a lot of my time at the moment. When I look inside the Also I don't know where it is done in the blog skeleton. Any advice appreciated. |
I think I found the reason. In the So the call to When I install from ZIP, |
I'm having the same problem using The |
I figured out my proglem. I was including If I exclude the limit from my |
can you explain this please? I cannot find the way to get this strange unusable plugin work |
I have exactly the same problem as @Genenenenaam and tried the I tried again with excluding the So it seems that the plugin is totally broken (no rendering + no CSS loaded in the assets in the |
Hello, There is an issue with the pagination plugin, if you have a collection to has less items than the limit, you get empty pagination instead of not getting a paginator at all. The reason is the pagination variable is initialized to true, and then never changed to an empty array. There the pagination|length gives 4 because it counts the number of letters in the word true instead of counting an empty array. There are 2 ways to fix this issue on line 124 of file pagination.php. Solution 1 makes has my preference. Regards, |
How about a pull request? |
Hi, I come back here to give more infos on what I discovered about the bugs. Summary :1 - How to use the plugin correctly (conflict) 1 - How to use the plugin correctly (conflict)In short : there's two way of calling the plugin in a page, and we can't use both or it will conflicts ! ReminderThe plugin necessitate two things :
And it allows one thing :
First method
Second method
2 - Excerpt of a full template processing
3 - Problem with modular pages, and workaroundModular page are rendered differently, and some things can be impossible to reach in the PHP during the events. So, because of this, the presence of a frontmatter So as a solution, just load manually the asset in your template that extends the
Or directly in the
I've conditioned it to a route, and assigned it to a group for more control, but that's totally optional. |
4 - Insights of the PHP, for possible fixes
But I don't understand why it would make the plugin to bug. 🤔 Anyway, it is clearly here, at this moment when the page_count is done, that the plugin fails if we have a set a I tried to set an integer, or between quotes ' '; but nothing works. |
On a twig template i use the 'Collection Object Methods' to difine a collection like it states in the GRAV documentation:
I pass this data to the plugin 'pagination.html.twig' template.
Here i have my issue:
In the plugin template '' the first condition will therefore always return false.
Looking inside the plugin template its unclear to me what correct data is expected.
And how to pass this through?
The text was updated successfully, but these errors were encountered: