Hello,

I would like to create a block using views. This block should show last comments on a certain type of node (Image) . I have tried with this configuration, but unfortunately it doesn't work. What am I doing wrong?

 $view = new stdClass();
  $view->name = 'comentarios_galeria';
  $view->description = 'Últimos comentarios de la galería de imágenes';
  $view->access = array (
);
  $view->view_args_php = '';
  $view->page = FALSE;
  $view->page_title = '';
  $view->page_header = '';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'node';
  $view->url = '';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '6';
  $view->block = TRUE;
  $view->block_title = 'Últimos comentarios galería';
  $view->block_header = '';
  $view->block_header_format = '1';
  $view->block_footer = '';
  $view->block_footer_format = '1';
  $view->block_empty = '';
  $view->block_empty_format = '1';
  $view->block_type = 'list';
  $view->nodes_per_block = '5';
  $view->block_more = TRUE;
  $view->block_use_page_header = FALSE;
  $view->block_use_page_footer = FALSE;
  $view->block_use_page_empty = FALSE;
  $view->sort = array (
  );
  $view->argument = array (
  );
  $view->field = array (
    array (
      'tablename' => 'comments',
      'field' => 'subject',
      'label' => '',
      'handler' => 'views_handler_field_commentlink',
      'options' => 'link',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'type',
      'operator' => 'OR',
      'options' => '',
      'value' => array (
  0 => 'image',
),
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(comments, node);
  $views[$view->name] = $view;

Thank you

Comments

neclimdul’s picture

I don't see anything wrong with your view. I changed the content type filter to point to a content type I had on my site that had comments and it worked fine.

What is the problem you are seeing? What steps have you gone through setting things up?

c-c-m’s picture

The problem is that nothing is displayed in the block's list. Only a blank space. The only thing I did is to create that view, and then activated it via Blocks administration. The block is displayed, but not its content. The weird thing is that other blocks don't show up until they have content to provide. This one is diplayed, but with no content, only the title, a blank space and a "more" link.

sun’s picture

Status: Active » Closed (won't fix)

Sorry, unfortunately this support request is way too specific. Please have a look at the issue queue - Views maintainers are buried already. You might want to try to get further support at http://drupal.org/support. Additionally, the answer to your question might be covered in the handbooks at http://drupal.org/handbook/modules/views already.
If you were able to solve this issue on your own in the meantime, you might want to add the involved steps to this closed issue, so other users searching for a similar solution might find it.