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

What Can The Paginator Paginate? #30

Closed
bobrocke opened this issue Aug 23, 2014 · 5 comments
Closed

What Can The Paginator Paginate? #30

bobrocke opened this issue Aug 23, 2014 · 5 comments
Labels

Comments

@bobrocke
Copy link

Grav has a paginator plug-in (pagination.php) that will divide "articles' into desecrate pages.

Does it work only with .md files or can it paginate a group of images files that are displayed in a <ul> and individual <li>s?

@rhukster
Copy link
Member

It paginates pages in a collection. Any collection of pages. The blog skeleton has a good example of this. Images are available per-page, and are an array that you can loop over easily in twig.

@rhukster
Copy link
Member

You know I just had a thought. If you have a simple set of pages, that have no content, only a image associated with each page, you could paginate over image that way. You could create a pretty flexible image gallery or portfolio that way.

@bobrocke
Copy link
Author

So, somewhat like a blog listing page has a number of blog post snippets on each of many paginated pages, this would allow a collection of .jpg files, for instance, to be paginated in that same way? You could pick, say 12 images per page and generate the pagination off that?

@rhukster
Copy link
Member

No i actually mean that each image would have its own page. You paginate over pages in a collection still, but the page could have little or no content, and your twig template, just displays the first image it finds for the page, ie media.images|first

By having each image in their own page, with their own folder, you can easily write a description (the page content) or add specific headers to the page to provide functionality like tags, meta data etc.

@mahagr
Copy link
Member

mahagr commented Aug 26, 2014

What you could also do is to create a simple plugin which turns images into pages and registers those to the Pages class (to the router). Those pages could them be used just like any other page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants