I was trying to create one pagenated album using Views 2.0. But I am not able to show either thumbnail image or preview image in my view. i have tried to use $node->teaser and $node->body as fields to be shown, but it still does not show any image in the view page.

Comments

chandrabhan’s picture

Status: Active » Closed (fixed)

I was able to achieve what I was looking for using Views module itself.

Luca O’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

[Deleted: double comment, sorry]

Luca O’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

How?

AaronCollier’s picture

Status: Closed (fixed) » Active

It is considered good form to write a description of how a problem was fixed. You also should keep it at fixed for 2 weeks before closing.

Also, this seems like a general problem. I cannot find the Image fields in views after upgrading to the alpha version. So I'm not sure how well the modules work together. It seems to have disappeared somewhat, but maybe that's just me.

chandrabhan’s picture

Status: Active » Fixed

The following creates a link to an album called "CA" created with Image which is passed as argument. let me know if it works for you folks


$view = new view;
$view->name = 'images';
$view->description = '';
$view->tag = 'undefined';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = '0';
$view->api_version = 2;
$view->disabled = FALSE; // Edit this to true to make a default view disabled initially
$view->display = array();
  $display = new views_display;
  $display->id = 'default';
  $display->display_title = 'Defaults';
  $display->display_plugin = 'default';
  $display->position = '1';
  $display->display_options = array(
  'style_plugin' => 'default',
  'style_options' => array(),
  'row_plugin' => 'fields',
  'row_options' => array(
    'inline' => array(
      'title' => 'title',
    ),
    'separator' => ',',
  ),
  'relationships' => array(),
  'fields' => array(
    'fid' => array(
      'id' => 'fid',
      'table' => 'upload',
      'field' => 'fid',
      'label' => '',
      'type' => 'separator',
      'separator' => ', ',
      'empty' => '',
      'relationship' => 'none',
      'link_to_file' => 1,
      'only_listed' => 1,
    ),
    'title' => array(
      'id' => 'title',
      'table' => 'node',
      'field' => 'title',
      'label' => '',
      'relationship' => 'none',
      'link_to_node' => 1,
    ),
  ),
  'sorts' => array(),
  'arguments' => array(
    'name' => array(
      'id' => 'name',
      'table' => 'term_data',
      'field' => 'name',
      'default_action' => 'summary asc',
      'style_plugin' => 'default_summary',
      'style_options' => array(
        'count' => TRUE,
        'override' => FALSE,
        'items_per_page' => 25,
      ),
      'wildcard' => 'all',
      'wildcard_substitution' => 'All',
      'title' => '',
      'default_argument_type' => 'fixed',
      'default_argument' => '',
      'validate_type' => 'none',
      'validate_fail' => 'not found',
      'glossary' => 1,
      'limit' => '1',
      'case' => 'none',
      'path_case' => 'none',
      'transform_dash' => 0,
      'relationship' => 'none',
      'default_argument_user' => 0,
      'default_argument_fixed' => '',
      'default_argument_php' => '',
      'validate_argument_node_type' => array(
        'blog' => 0,
        'poll' => 0,
        'image' => 0,
        'forum' => 0,
        'book' => 0,
        'page' => 0,
        'story' => 0,
      ),
      'validate_argument_node_access' => 0,
      'validate_argument_nid_type' => 'nid',
      'validate_argument_vocabulary' => array(
        '2' => 0,
        '1' => 0,
        '3' => 0,
      ),
      'validate_argument_type' => 'tid',
      'validate_argument_php' => '',
      'add_table' => 0,
      'require_value' => 0,
    ),
  ),
  'filters' => array(
    'type' => array(
      'id' => 'type',
      'table' => 'node',
      'field' => 'type',
      'operator' => 'in',
      'value' => array(
        'image' => 'image',
      ),
      'group' => 0,
      'exposed' => FALSE,
      'expose' => array(
        'operator' => FALSE,
        'label' => '',
      ),
      'relationship' => 'none',
      'expose_button' => array(
        'button' => 'Expose',
      ),
    ),
  ),
  'items_per_page' => 1,
  'use_ajax' => '1',
  'use_pager' => '1',
  'pager_element' => 0,
  'offset' => 0,
);
$view->display['default'] = $display;
  $display = new views_display;
  $display->id = 'page';
  $display->display_title = 'Page';
  $display->display_plugin = 'page';
  $display->position = '2';
  $display->display_options = array(
  'defaults' => array(
    'access' => TRUE,
    'title' => TRUE,
    'header' => TRUE,
    'header_format' => TRUE,
    'header_empty' => TRUE,
    'footer' => TRUE,
    'footer_format' => TRUE,
    'footer_empty' => TRUE,
    'empty' => TRUE,
    'empty_format' => TRUE,
    'use_ajax' => TRUE,
    'items_per_page' => TRUE,
    'offset' => TRUE,
    'use_pager' => TRUE,
    'pager_element' => TRUE,
    'use_more' => TRUE,
    'distinct' => TRUE,
    'link_display' => TRUE,
    'style_plugin' => FALSE,
    'style_options' => FALSE,
    'row_plugin' => FALSE,
    'row_options' => FALSE,
    'relationships' => TRUE,
    'fields' => TRUE,
    'sorts' => TRUE,
    'arguments' => TRUE,
    'filters' => TRUE,
  ),
  'relationships' => array(),
  'fields' => array(),
  'sorts' => array(),
  'arguments' => array(),
  'filters' => array(),
  'menu' => array(
    'type' => 'normal',
    'title' => 'im',
    'weight' => '0',
  ),
  'path' => 'CA',
  'style_plugin' => 'default',
  'style_options' => array(),
  'row_plugin' => 'node',
  'row_options' => array(
    'teaser' => 0,
    'links' => 1,
  ),
);
$view->display['page'] = $display;
  $display = new views_display;
  $display->id = 'attachment';
  $display->display_title = 'Attachment';
  $display->display_plugin = 'attachment';
  $display->position = '3';
  $display->display_options = array(
  'defaults' => array(
    'access' => TRUE,
    'title' => TRUE,
    'header' => TRUE,
    'header_format' => TRUE,
    'header_empty' => TRUE,
    'footer' => TRUE,
    'footer_format' => TRUE,
    'footer_empty' => TRUE,
    'empty' => TRUE,
    'empty_format' => TRUE,
    'use_ajax' => FALSE,
    'items_per_page' => FALSE,
    'offset' => FALSE,
    'use_pager' => FALSE,
    'pager_element' => FALSE,
    'use_more' => TRUE,
    'distinct' => TRUE,
    'link_display' => TRUE,
    'style_plugin' => TRUE,
    'style_options' => TRUE,
    'row_plugin' => TRUE,
    'row_options' => TRUE,
    'relationships' => TRUE,
    'fields' => TRUE,
    'sorts' => TRUE,
    'arguments' => TRUE,
    'filters' => TRUE,
  ),
  'relationships' => array(),
  'fields' => array(),
  'sorts' => array(),
  'arguments' => array(),
  'filters' => array(),
  'attachment_position' => 'before',
  'inherit_arguments' => 0,
  'displays' => array(
    'page' => 'page',
    'default' => 0,
  ),
  'use_ajax' => '0',
  'items_per_page' => 10,
  'offset' => 0,
  'use_pager' => '1',
  'pager_element' => 0,
);
$view->display['attachment'] = $display;

AaronCollier’s picture

That does not work for me. I only get "Unable to interpret view code."

tuwebo’s picture

Hi AaronCollier, and all the other people,
I had the same error (I´m new in drupal), I think you could solve it by removing the leading <?php and the end ?> tags from #5 (Jonga) post´s code. This way, when you import the view you should be able to create it.
I was able to create it but then I have this other error mesage in one of the view´s field:
- Error: handler for upload > fid doesn't exist!
The other field was sucessfully created as "Node: Title"
It will be good that views and Image modules work together!
Some help here would be very good.
Thanks in advance.

tuwebo’s picture

Status: Fixed » Active

Hi all,
Sorry but I will set this issue as active since it looks like that the only solution didn´t work.

drewish’s picture

Title: Working with Views » Add Views 2 support
Category: support » task

when the initial update for drupal 6 was done views 2 wasn't ready so no update for views was done.

AaronCollier’s picture

Status: Active » Closed (duplicate)
OldAccount’s picture

AaronCollier, I was getting the "Unable to interpret view code" error too but I resolved it by turning off FCKEditor on the Views import and export pages.