I followed this popular tutorial http://drupal.org/node/144725 on creating galleries with CCK and views, and now I have several galleries that I would like to link to from a page of thumbnails in a grid that resembles the galleries generated using the CCK, Views and grids from Views Bonus Pack.
Basically, I'd like a grid of thumbnails that when one is clicked, I go to that gallery.
The thing I haven't figured out yet is how do I set the thumbnail to link to an arbitrary node or URL instead of linking to the original photo?
I tried making another Thumbnail content type with Image and Link fields, but the closest I could get was having the link written out above the thumbnail. It seems like there ought to be a way to add some PHP to override the thumbnail's link with the data in the link field.
Here is my view if it helps:
$view = new stdClass();
$view->name = 'Gallery';
$view->description = 'Gallery';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'Photo Galleries';
$view->page_header = 'Below are thumbnail links to the various galleries.';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'bonus_grid';
$view->url = 'gallery';
$view->use_pager = TRUE;
$view->nodes_per_page = '12';
$view->sort = array (
);
$view->argument = array (
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => '',
'handler' => 'views_handler_field_nodelink',
'options' => 'nolink',
),
array (
'tablename' => 'node_data_field_gallery_images',
'field' => 'field_gallery_images_fid',
'label' => '',
'handler' => 'content_views_field_handler_ungroup',
'options' => 'Square_Thumbnail_linked',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'gallery_thumbnail',
),
),
);
$view->exposed_filter = array (
);
$view->requires = array(node, node_data_field_gallery_images);
$views[$view->name] = $view;
Thanks, Chris