ZenphotoCMS Forum
Dynamically changing number of images per page and pagination - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Dynamically changing number of images per page and pagination (/thread-5976.html)



Dynamically changing number of images per page and pagination - dmitriid - 2009-10-13

Hi, all

Most albums on my site use a "20 images per page" setting that can be set in theme options.

However, some albums require just 8 or 10 images per page.

It took me hours to find out that it's possibly
setOption('albums_per_page', 8, false);

However, this screws up ZP's logic when assigning page numbers in breadcrumbs.

Here's what I mean:

The global option set in the admin backend is 20 images per page
Lets say I have 12 images in my album.
I want to display 8 images per page.
I do a setOption('albums_per_page', 8);
8 images per page are displayed
I switch to page 2
I click on an image
I click on the album name in the breadcrumb
I'm taken back to page 1

How do I correct that?

If this is an option that can be set with setOption, please tell me which option this is, because it is absolutely impossible to find out which options can be set.

Thank you.




Dynamically changing number of images per page and pagination - acrylian - 2009-10-13

You have to set "images_per_page", this is for the thumbnails of the image in an album. "album_per_page" is for the display of the thumbs of the albums itself.




Dynamically changing number of images per page and pagination - dmitriid - 2009-10-13

And bang! It works. Thank you!

Now... If only ZP had a doc page listing all available options... It could save me personally two days of wasted time




Dynamically changing number of images per page and pagination - acrylian - 2009-10-13

Well, you could have asked earlier..;-) You could just look into your database's options table and/or the zp-core/setup-option-defaults.php file.




Dynamically changing number of images per page and pagination - dmitriid - 2009-10-13

So that's where the were!

Thank you




Dynamically changing number of images per page and pagination - sbillard - 2009-10-13

There is no where where there is a complete list. Setup will contain the Standard Options, but themes can add their own options. The database will contain all that have been "seen", but perhaps a theme has not yet added an option, so it will not be there.

But maybe more to the point is that you can view the various pages of the admin option tabs. There will be listed (organized by function) all the options that are currently of any interest.