Can't Override Gallerix Grid View!
tflmike - July 30, 2008 - 08:32
| Project: | Gallerix |
| Version: | 5.x-1.3-1 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Jump to:
Description
Hello-
I like you module! It was fairly quick and painless to set up, create my first gallery and theme the album pages... so far so good... but then I tried to use the Views Theme Wizard to override the standard Gallerix grid view page. I put all the necessary code into my template.php file, I create the tpl.php and .css files, but every time I go to the gallerix grid view page I just get the same stock theme.
How would I got about theming this page? Is the code set up so that this view is themable?
Thanks!

#1
tflmike,
First off: if you're talking about overriding the grid with all that albums, that shouldn't be a problem. However, if you're trying to override the grid view within an album, then that can't be done with views.
If you're aiming for the former:
I hope that helps,
Silvio
#2
This is due to the way the gallerix module was developed. The author created a function called theme_views_view_gallerix_grid() which superceed the template you are trying to create using the theme wizard.
I tried overriding the view and putting header/footer/empty text. None of those were working.
I adapted the function theme_views_view_gallerix_grid() to allow supporting header/footer/empty text. I simply took what the theme_views_view() function was doing and incorporated it into the theme_views_view_gallerix_grid().
If you want to theme it yourself, you can create a function called
phptemplate_views_view_gallerix_grid($view, $type, $nodes, $level = NULL, $args = NULL)
which will be a copy of theme_views_view_gallerix_grid() but with your own addition/modifications.
If you want to use a template file, you will have to call _phptemplate_callback() somewhere in your function.
I think a better approach for this module would be to get ride of theme_views_view_gallerix_grid() so that views can call the normal/standard theme_views_view() function and then you can override each individual photo by doing the theme wizard trick.
They are many problems caused by the current approach:
* header/footer/empty text not supported
* Theme wizard not supported
* The style is "list" but it does not even use it (do you see any <li> in the output?).
It would be better to create a new view style instead of the list is not a good option.