Dynamically changing number of images per page and pagination

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.

Comments

  • acrylian Administrator, Developer
    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.
  • 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
  • acrylian Administrator, Developer
    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.
  • So that's where the were!

    Thank you
  • 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.
Sign In or Register to comment.