How To Paginate A Gallery Block?
Permalink
I have a custom block that displays image thumbnails and selection/ordering controls in a grid of 4 images per row. I'd like to limit the display to 4 rows (16 images) and then have previous/next controls at the bottom to move though what might be a long list of images that are all part of a file set.
There are a number of posts on the forum about paginating the output from a database query, but that doesn't seem to apply to what I'm thinking.
Is there a reference somewhere on how to do this pagination? I don't see any concrete5 documentation online for the paginator helper, at all.
If there's no reference, how would I approach the code?
There are a number of posts on the forum about paginating the output from a database query, but that doesn't seem to apply to what I'm thinking.
Is there a reference somewhere on how to do this pagination? I don't see any concrete5 documentation online for the paginator helper, at all.
If there's no reference, how would I approach the code?
That certainly looks nice, but my design calls for a grid of images, each of which will have selection and purchase controls. So I need a way to paginate what my block displays.
If your layout is done using floated div elements, my Front End List Magic addon can paginate list-like structures after they have been added to a page. You would still have the full load of the thumbnails with the page, but the addon would paginate it for you. It can also add some transition effects.
If your layout does tables, then Front End List Magic would not be able to help you.
If your layout does tables, then Front End List Magic would not be able to help you.
The "list" would be a series of <div>, each with an image, some text, and some AJAX controls inside.
Would that work?
Would that work?
It can certainly locate and work with series of div elements.
With the script/ajax, I can only say probably.
When the page loads it finds the list (in your case div) elements and marks them with a marker class.
For users with edit access, when front-end editing, it allows them to be drag/drop sorted and marked as hidden/revealed to edit on the page.
When not editing, it hides those marked 'hidden' and paginates those left.
For users without edit access, it marks list (div) elements as before, but actually removes from the page those 'hidden' by the edit, then sorts and paginates those remaining, all according to whatever was set by the previous front-end edit.
All this is done in javascript after the page has loaded.
So if your gallery script and ajax controls depend on a fixed relationship between adjacent divs, something will fail because expected elements will be missing. If your gallery script and ajax controls work out any relationships between adjacent divs dynamically, then it will most likely work.
With the script/ajax, I can only say probably.
When the page loads it finds the list (in your case div) elements and marks them with a marker class.
For users with edit access, when front-end editing, it allows them to be drag/drop sorted and marked as hidden/revealed to edit on the page.
When not editing, it hides those marked 'hidden' and paginates those left.
For users without edit access, it marks list (div) elements as before, but actually removes from the page those 'hidden' by the edit, then sorts and paginates those remaining, all according to whatever was set by the previous front-end edit.
All this is done in javascript after the page has loaded.
So if your gallery script and ajax controls depend on a fixed relationship between adjacent divs, something will fail because expected elements will be missing. If your gallery script and ajax controls work out any relationships between adjacent divs dynamically, then it will most likely work.
There is an add-on in the marketplace that might help you:
http://www.concrete5.org/marketplace/addons/gallerific/...
jordi