Overriding ZP albums_per_page and images_per_page

Is there any way to override the ZP admin albums/images per page values in an individual theme?

I am trying to override the number of album thumbs and image thumbs per page by using the following in my index.php and albums.php files, respectively using the following code at the top of my files:

[code]
<?php $_zp_conf_vars['albums_per_page'] = 20; ?>
[/code]
and
[code]
<?php $_zp_conf_vars['images_per_page'] = 30; ?>
[code]

They seem to have no effect, I still get the number of thumbs as set in the ZP admin theme options.

I also tried placing the same code in the themeoptions.php file, still no effect.

Also tried to set the defaul options in the themeoptions.php ThemeOptions() function - it still does not work.

[code]
setOptionDefault('albums_per_page', 12); setOptionDefault('images_per_page', 12);
[/code]

Comments

  • Which version of zenphoto are you using? Also which theme? Some themes (in older versions of zenphoto) use the normalizecolumns option at the beginning of the theme's index page.
  • acrylian Administrator, Developer
    setOptionDefault() is the wrong function, you should use setOption(). Note that it has a extra parameter to either set the value permanently or temporarily. You can do this with all options. See the documentation for that.
  • I am using the normalizeColumns functions in the theme - is it no longer needed?

    I am using the latest version and with a theme I am working on. The setOption function worked out.
  • acrylian Administrator, Developer
    normalizeCOlumns is currently needed but will not be needed anymore with the coming 1.3.2.
  • Please note that breadcrumbs will not work unless the theme is consistent in its #per page settings. Practically this means that if you are setting it not permanant you need to do so in each and every page involved with breadcrumbs.
Sign In or Register to comment.