[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
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 - is it confusing? #334

Closed
edwardhorsford opened this issue Dec 7, 2018 · 4 comments
Closed

Pagination - is it confusing? #334

edwardhorsford opened this issue Dec 7, 2018 · 4 comments
Labels
documentation needs-discussion Please leave your opinion! This request is open for feedback from devs.
Milestone

Comments

@edwardhorsford
Copy link
Contributor

I find pagination somewhat confusing, and I wonder if others do too. It took me quite a while to get my head around it - particularly the 'sizes' bit (actually I'm still confused how sizes works). It's really flexible and capable, but I feel like this capability non-obvious.

I think this is because it's meeting two distinct needs - doing page-per-thing (dynamic pages), and doing pagination of a thing in groups of n (pagination).

Possibly the name isn't right? Pagination has very specific connotations - but can do so much more! Dynamic pages might be better? Or Both? Pagination was the solution to #326 - but I don't think it's the obvious place to look - dynamic pages might have been.

I've run against this when trying to list all the pages created by pagination (not currently possible, as they're not listed in collections.all). It's intentionally not supported because the original thinking was that when you're paginating in groups of n, only the first is relevant - but when you're doing page per thing, it's very relevant.

What do others think?

Is there potential for it to be split out? this might help for supporting things like #332?

@zachleat zachleat added the needs-discussion Please leave your opinion! This request is open for feedback from devs. label Dec 7, 2018
@jevets
Copy link
jevets commented Dec 19, 2018

I've been soaking on this since you posted this.

I don't think it's horribly confusing, but it certainly did take me a few sessions working w/ pagination to get the hang of it. I'm with you on that.

I see it as more of a chunk helper. Partition is another term that comes to mind.
laravel chunk helper
lodash chunk method
Eleventy's pagination also works with permalinks and remapping them, which makes it quite powerful compared to a general-purpose chunk method.

Most of my projects grab data from external APIs and load it into 11ty as global data, and I generate pages with that data (using pagination and permalink mapping), so maybe pagination gets more painful when dealing with a structure having many markdown files and/or collections, each having many tags, dates, etc. Agree/dis?

Seemed that the most pressing issue was the lack of built-in support for multiple paginations, but @zachleat's comment on #332 provides a friendly solution (I haven't tried it yet, but it's not bad at a glance).

@edwardhorsford

  • Do you still feel confused about the size parameter?
  • Have you worked with it much more, still find the whole thing confusing?
  • Any new thoughts on it since posting?

Maybe we should publish a few more "recipes" or "tips" on how to accomplish some common tasks where pagination can be used outside the context of page/1, page/2, etc. One that comes to mind is some how-to on Dynamic Pages. (I think I ended up finding that solution via a github issue)

@edwardhorsford
Copy link
Contributor Author
edwardhorsford commented Dec 20, 2018

@jevets no more thoughts really. I didn't get much response to this - so perhaps others don't find it confusing (which is good obviously). More than anything, I feel like my confusion is around the name.

Do you still feel confused about the size parameter?

Half and half - I guess half my issue is that it doesn't make as much sense when you're doing a page per thing. I just leave at 1 and it seems to work.

More tips / tutorials would definitely be good. Eleventy is so capable, it's hard to know where to start!

My personal biggest issue remains that items created with pagination aren't listed in collections.all - which is very awkward for me as so many of my pages are dynamic (#253).

@braco
Copy link
braco commented Apr 7, 2019

I found this confusing, yes. Creating pages from data is a common use case in building sites, and "pagination" isn't the right terminology.

It also seems half-formed as a feature since it's impossible(?) to create dynamic titles, etc. from the pagination data since frontmatter is static outside of permalink? Lots of gotchas. If that's wrong, take that as another point toward this being confusing :)

@zachleat
Copy link
Member

Added some additional documentation around this to help with the confusion (which to be fair, is a bit ongoing)

11ty/11ty-website@2ad3d49

Note also that the collections.all has also been documented since this issue was filed https://www.11ty.io/docs/collections/#the-special-all-collection

Please let me know if there are additional steps we should take here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation needs-discussion Please leave your opinion! This request is open for feedback from devs.
Projects
None yet
Development

No branches or pull requests

4 participants