G2-rc1: remove default rows, cols, perpage

kbarr

Joined: 2005-08-29
Posts: 11
Posted: Mon, 2005-08-29 19:03

in album.tpl, {foreach from=$theme.children item=child}
is weird in that it only iterates through perPage children rather than all thumbnails.

For my customized theme, I would like to display ALL thumbnails on the album page and let the user scroll down as necessary. Also, I'm using float:left; so the concept of rows and columns is gone.

How do I prevent a default rows/cols/perPage from being imposed on my album? What's the cleanest way? Here's what I've tried:

1. removing 'rows','columns','perPage' arguments from the call to setStandardSettings()

2. Inspired by siriux's code, placing this stanza above and below the call to loadCommonTemplateData

 
        if (isset($theme['params']['rows'])) {
            unset($theme['params']['rows']);
        }
        if (isset($theme['params']['columns'])) {
            unset($theme['params']['columns']);
        }
        if (isset($theme['params']['perPage'])) {
            unset($theme['params']['perPage']);
        }

It seemed to work for one album
http://cag.lcs.mit.edu/~kbarr/photos/gallery2/v/adk/
but not for
http://cag.lcs.mit.edu/~kbarr/photos/gallery2/v/gleeclub/
which remembers a perPage = 9 even after I've removed it from the code.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-08-30 01:51

#1 is correct.. it didn't work because you still have settings for rows, cols etc in the db.
You can clean these out and clear cache, or just rename your theme..

 
kbarr

Joined: 2005-08-29
Posts: 11
Posted: Tue, 2005-08-30 14:09

Thanks for your quick response. Unfortunately, I tried clearing the template and database cache and running db optimization: (all from the site admin / maintenance menu). no change. Did you say I needed to clear something from the mysql database first? Where are the rows/cols stored?

I tried copying the theme to a new directory, doing a s/matrix/kbarr/, but no luck. I re-ran the cache delete steps, and still no change.

I even tried deleting and recreating a new album with the new "kbarr" template. Same issue.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-08-30 15:41

g2_PluginParameterMap.. look for rows with g_pluginId = {yourtheme} to find the rows/columns settings.
when you moved the theme to a new directory it sounds like you changed the classname and setId lines in theme.inc. you then had to install and activate this theme and select it as your default theme or assign an album to use it.. at this point you still didn't see all child items? check your g2_PluginParameterMap table and make sure there are no rows/columns/perPage for this theme.

 
kbarr

Joined: 2005-08-29
Posts: 11
Posted: Tue, 2005-08-30 15:58

thanks, when I renamed it didn't make me install/activate, so I guess it didn't refresh the db correctly.

I ran these commands, cleared the cache, and all is well. Thanks!

mysql> delete  from g2_PluginParameterMap where g_pluginId = 'kbarr ' and g_parameterName = 'rows';

mysql> delete  from g2_PluginParameterMap where g_pluginId = 'kbarr ' and g_parameterName = 'columns';

mysql> delete  from g2_PluginParameterMap where g_pluginId = 'kbarr ' and g_parameterName = 'perPage';