cck/imageField/imageCache | Good image gallery tips or tutorials

Danny_Joris - July 3, 2009 - 18:35

Hey all,

I would like to build an image gallery with cck/imageField/imageCache/views, etc... I first tried the image.module is because it's required to use the Image Gallery, which i find pretty handy. But it was not compatible with imageCache.

So with Imagefield and ImageCache alone, is there a good way to build galleries with it? I can't seem to find any good tutorials or tips around. I did find this D5 tutorial, but i need one for D6. Or do the methods for D6 remain the same?

In the end, i might be able to build one with Taxonomy etc (like in that D5 tutorial), but i don't want to bother my clients/administrators with abstract terms like Vocabulary or Taxonomy when they just need to add another album.

Hope there are good sollutions for this...

Thanks in advance,
Danny

_

WorldFallz - July 3, 2009 - 18:44

My current favorite method is captured by this screencast: http://www.lullabot.com/articles/photo-galleries-views-attach

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

=-=

Danny_Joris - July 3, 2009 - 19:31

Sweeeeet ! ...

_

Danny_Joris - July 6, 2009 - 14:58

Sorry to bother you again, but have you encountered this problem before?

Danny

_

WorldFallz - July 6, 2009 - 16:30

Sorry-- I didn't use the features module to create this gallery, I created it manually as described in the video.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

_

Danny_Joris - July 6, 2009 - 16:54

Hmm, I didn't need the Features module either, but it was required by 'Views Gallery'. I didn't have the 'Full Gallery' option in Views at 8:30 in the video, so i thought that was because i hadn't installed 'Views Gallery' yet...

I just deleted Features directly from the server because i did not see another way to delete it. I did this and now Features is gone in my module list and Views Gallery is visible again.

Visible, but still unable to delete it. And in red it asks for the Features module. Is the 'views gallery' not required then for the tutorial?

I'm absolutely stuck :(

Danny_Joris - July 7, 2009 - 15:06

So: in my current website I am able to import the View for Gallery. But I am unable to build a new view to see the Gallery Teasers. I tried all day. No success. I also don't see the buttons to quickly upload a new image related to that gallery. And I have no idea where to start to build them myself. There are two Blocks that got imported together with the Gallery_photos view, but they both are just one apply-button that doesn't do anything. Maybe these are supposed to be the 'add-photo' buttons? Maybe something went wrong?

Besides that, i tried to reinstall this on a fresh drupal install. But here I don't even get to the point to upload the views with image-attach. It gives the following warning. I installed all the cck modules there are available in an acquia install plus the nodereference_url module.

This is getting all too much for me. I'm about to go crazy just for a simple thing as an image gallery. I can't believe this. I'm studying Drupal for 6 months now full time on my own, without earning one dollar! The only information i get is from this website and my O'Reilly's Using Drupal book. And I actually need to focus on graphic design as well. I thought Drupal was suppost to make building websites easier. Drupal is still far removed from that point.

_

WorldFallz - July 7, 2009 - 15:38

Sorry to hear you're having such a hard time with it-- I honestly didn't do anything special. I've been doing a variation of this type of gallery for a while now but I did follow along with this video and made the gallery as described no problem.

However, I didn't install anything (other than the modules themselves) and i didn't import anything-- i just followed the screencast. I didn't use the css injector module, just the cck, views, nodereference_url, and views_attach modules. It's the nodereference_url module that creates the 'add photo' link which is then just styled to appear like a button with css.

Maybe just clear your head, take a deep breadth, start over fresh and follow the screenast, pausing as necessary to make sure you've got what's described.

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

_

Danny_Joris - July 8, 2009 - 03:47

Thanks for your support and patience. Yes, I'm going to take it a little slower. I want to take a few steps back. Unfortunatley the Views_Gallery module ruined my setup. I cant uninstall Views_Gallery and it has made two content types that I'm unable to delete as well. I didn't even screw around with code or such. I just installed what Jeff Eaton gave us with his video tutorial. I might look in the database. I know it is dangerous, but my current install is ruined anyway...

--EDIT: I deleted them in 'node_type'. Not sure if there are bad consequences to this, I'll see...

--EDIT2: Why Drupal Sucks: Do you know what to do if you encounter an error like this?

    * Field handler node_data_field_image.field_image_fid is not available.
    * Field handler node_data_field_image.field_image_fid is not available.
    * Field handler node_data_field_image.field_image_fid is not available.
    * Unable to import view.

I don't...

_

Danny_Joris - July 8, 2009 - 06:13

Ok, exit frustration mode, enter sleep mode. I got it fixed... :)

I'm not sure what I did, but I think the main reason could be conflicting node type template files that I made.

Thanks for all your patience and coping with the nagging... :)

_

WorldFallz - July 8, 2009 - 13:46

lol-- glad you got it!

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.

Similar frustrations

Ghetto_Prodigy - October 22, 2009 - 00:57

Hi Danny,

I am running into the exact same error message (except I never installed Features). I watch the rather excellent intro video followed it step for step, but kept getting a message about a missing handler in Views.

So I went the Danny route, deleted every content type node that I had created, cleared my cache and decided to import the Views Gallery data from intro video with Eaton.

Ending up with the none to friendly:

"Field handler node_data_field_image.field_image_fid is not available"

unable to import view

Danny, any tips for figuring this out? Or might you be able to export your views for this "gallery" and "photo"... maybe that can fix the problem on my end...

Thanks, thanks, thanks...

Darryl

"The world changes when one believes it can be changed. The depth of the change is only limited by one's own belief."

_

Danny_Joris - October 23, 2009 - 17:41

Hmm, this is a while ago. I can't fully remember what I did to fix this. For sure don't use Features. I think I followed WorldFallz advice and did everything step by step along with the video tutorial. I'll put my views export code here though, If it might help you. I remember that I didn't fully understood what views_attach was all about.

gallery_List:

$view = new view;
$view->name = 'gallery_list';
$view->description = 'Gallery List';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'title' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'created' => array(
    'order' => 'ASC',
    'granularity' => 'second',
    'id' => 'created',
    'table' => 'node',
    'field' => 'created',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'gallery' => 'gallery',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('title', 'Albums');
$handler->override_option('empty', 'Nog geen albums toegevoegd.');
$handler->override_option('empty_format', '1');
$handler->override_option('use_ajax', TRUE);
$handler->override_option('items_per_page', 6);
$handler->override_option('use_pager', 'mini');
$handler->override_option('style_plugin', 'grid');
$handler->override_option('style_options', array(
  'columns' => '3',
  'alignment' => 'horizontal',
));
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
  'relationship' => 'none',
  'build_mode' => 'teaser',
  'links' => 0,
  'comments' => 0,
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'album');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
));

gallery_photos:

$view = new view;
$view->name = 'gallery_photos';
$view->description = 'gallery photos';
$view->tag = 'gallery';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'field_photo_fid' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'imageThumb_linked',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 0,
    'id' => 'field_photo_fid',
    'table' => 'node_data_field_photo',
    'field' => 'field_photo_fid',
    'relationship' => 'none',
  ),
  'created' => array(
    'label' => 'Toegevoegd op',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'date_format' => 'small',
    'custom_date_format' => '',
    'exclude' => 0,
    'id' => 'created',
    'table' => 'node',
    'field' => 'created',
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'created' => array(
    'order' => 'ASC',
    'granularity' => 'second',
    'id' => 'created',
    'table' => 'node',
    'field' => 'created',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('arguments', array(
  'field_gallery_nid' => array(
    'default_action' => 'ignore',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '',
    'breadcrumb' => '',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'node',
    'validate_fail' => 'not found',
    'break_phrase' => 0,
    'not' => 0,
    'id' => 'field_gallery_nid',
    'table' => 'node_data_field_gallery',
    'field' => 'field_gallery_nid',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
      '3' => 0,
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'gallery' => 'gallery',
      'page' => 0,
      'photo' => 0,
      'project' => 0,
    ),
    'validate_argument_node_access' => 1,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(),
    'validate_argument_type' => 'tid',
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
    'validate_argument_php' => '',
  ),
));
$handler->override_option('filters', array(
  'status_extra' => array(
    'id' => 'status_extra',
    'table' => 'node',
    'field' => 'status_extra',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('use_ajax', TRUE);
$handler->override_option('items_per_page', 8);
$handler->override_option('use_pager', 'mini');
$handler->override_option('style_plugin', 'grid');
$handler->override_option('style_options', array(
  'columns' => '4',
  'alignment' => 'horizontal',
));
$handler = $view->new_display('node_content', 'Full Gallery', 'node_content_1');
$handler->override_option('types', array(
  'gallery' => 'gallery',
));
$handler->override_option('modes', array(
  '0' => 'full',
));
$handler->override_option('argument_mode', 'nid');
$handler->override_option('default_argument', '');
$handler = $view->new_display('node_content', 'Latest Image', 'node_content_2');
$handler->override_option('fields', array(
  'field_gallery_nid' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'default',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 1,
    'id' => 'field_gallery_nid',
    'table' => 'node_data_field_gallery',
    'field' => 'field_gallery_nid',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
  'field_photo_fid' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 1,
      'path' => 'album/[field_gallery_nid]',
      'link_class' => '',
      'alt' => 'album teaser',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'imageThumb_default',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 0,
    'id' => 'field_photo_fid',
    'table' => 'node_data_field_photo',
    'field' => 'field_photo_fid',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
));
$handler->override_option('sorts', array(
  'created' => array(
    'order' => 'DESC',
    'granularity' => 'second',
    'id' => 'created',
    'table' => 'node',
    'field' => 'created',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
));
$handler->override_option('items_per_page', 1);
$handler->override_option('use_pager', '0');
$handler->override_option('style_plugin', 'default');
$handler->override_option('style_options', array(
  'grouping' => '',
));
$handler->override_option('types', array(
  'gallery' => 'gallery',
));
$handler->override_option('modes', array(
  '0' => 'teaser',
));
$handler->override_option('argument_mode', 'nid');
$handler->override_option('default_argument', '');

pager_photos:

$view = new view;
$view->name = 'pager_photos';
$view->description = 'pager for photos';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
  'field_gallery_nid' => array(
    'label' => 'Gallery',
    'required' => 1,
    'delta' => -1,
    'id' => 'field_gallery_nid',
    'table' => 'node_data_field_gallery',
    'field' => 'field_gallery_nid',
    'relationship' => 'none',
  ),
));
$handler->override_option('fields', array(
  'nid' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_node' => 0,
    'exclude' => 0,
    'id' => 'nid',
    'table' => 'node',
    'field' => 'nid',
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'nid' => array(
    'default_action' => 'ignore',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '',
    'breadcrumb' => '',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'node',
    'validate_fail' => 'not found',
    'break_phrase' => 0,
    'not' => 0,
    'id' => 'nid',
    'table' => 'node',
    'field' => 'nid',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
      '3' => 0,
    ),
    'relationship' => 'field_gallery_nid',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'gallery' => 'gallery',
      'page' => 0,
      'photo' => 0,
      'project' => 0,
    ),
    'validate_argument_node_access' => 1,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(),
    'validate_argument_type' => 'tid',
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
    'validate_argument_php' => '',
  ),
));
$handler->override_option('filters', array(
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'photo' => 'photo',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('items_per_page', 0);
$handler->override_option('row_options', array(
  'inline' => array(),
  'separator' => '',
));

_

Danny_Joris - October 23, 2009 - 17:42

Hmm, was this too much? :)

 
 

Drupal is a registered trademark of Dries Buytaert.