2

I'm creating a view that lists full view of nodes.

These nodes have comments and the comments are showing up as they should on their node page, but not when they're listed in the view.

"Display Comments" option is checked in Views in the row style settings.

Here is the exported view, it may be helpful. There is a second Block display where I list Full nodes, showing comments is checked.

$view = new view();
$view->name = 'flickr_images';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Flickr Images';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'See What Others Are Sharing';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['style_plugin'] = 'grid';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: Content: Image */
$handler->display->display_options['fields']['field_image']['id'] = 'field_image';
$handler->display->display_options['fields']['field_image']['table'] = 'field_data_field_image';
$handler->display->display_options['fields']['field_image']['field'] = 'field_image';
$handler->display->display_options['fields']['field_image']['label'] = '';
$handler->display->display_options['fields']['field_image']['exclude'] = TRUE;
$handler->display->display_options['fields']['field_image']['element_type'] = '0';
$handler->display->display_options['fields']['field_image']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_image']['element_wrapper_type'] = '0';
$handler->display->display_options['fields']['field_image']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['field_image']['click_sort_column'] = 'fid';
$handler->display->display_options['fields']['field_image']['settings'] = array(
  'image_style' => 'flickr_thumb',
  'image_link' => '',
);
$handler->display->display_options['fields']['field_image']['field_api_classes'] = TRUE;
/* Field: Global: PHP */
$handler->display->display_options['fields']['php']['id'] = 'php';
$handler->display->display_options['fields']['php']['table'] = 'views';
$handler->display->display_options['fields']['php']['field'] = 'php';
$handler->display->display_options['fields']['php']['label'] = '';
$handler->display->display_options['fields']['php']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['php']['use_php_setup'] = 0;
$handler->display->display_options['fields']['php']['php_output'] = '<a href="#" class="photo-container" data-reveal-id="<?php print $data->_field_data[\'nid\'][\'entity\']->field_flickr_id[\'und\'][0][\'safe_value\']; ?>">  
  <div>
    <div class="photo-tweet photo-container"><?php print $data->field_field_image[0][\'rendered\']; ?></div>
  </div>
</a>';
$handler->display->display_options['fields']['php']['use_php_click_sortable'] = '0';
$handler->display->display_options['fields']['php']['php_click_sortable'] = '';
/* Sort criterion: Content: Post date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
  'flickr_image' => 'flickr_image',
);

/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block');

/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['style_options']['default_row_class'] = FALSE;
$handler->display->display_options['style_options']['row_class_special'] = FALSE;
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'node';
$handler->display->display_options['row_options']['view_mode'] = 'full';
$handler->display->display_options['row_options']['links'] = FALSE;
$handler->display->display_options['row_options']['comments'] = TRUE;
$handler->display->display_options['defaults']['row_options'] = FALSE;
$translatables['flickr_images'] = array(
  t('Master'),
  t('See What Others Are Sharing'),
  t('more'),
  t('Apply'),
  t('Reset'),
  t('Sort by'),
  t('Asc'),
  t('Desc'),
  t('Block'),
);

Do you know what could be the problem?

6
  • I'm able to get the comments in views 7.x-3.3. Which version of views module you're using. It would be better if you put the exported the view. Jul 26, 2013 at 17:57
  • I use 7.x-3.7, I updated the question with the exporter view Jul 26, 2013 at 21:58
  • 1
    Have you tried create node display with Display Suite module?
    – milkovsky
    Jul 30, 2013 at 22:25
  • I'm not using DS on this site currently and I wrote a very custom template for the node, turning on DS and using the DS one column layout for example will result in a lot of redoing. I might do that anyway, because there doesnt seem to be a solution for this problem Jul 31, 2013 at 7:04
  • @milkovsky I actually set the display mode to Display Suite from Content and it works! I didn't have to write new templates at all. If you put this in as a proper answer I'll mark it as a good answer. Jul 31, 2013 at 8:38

3 Answers 3

2
+50

Create node display with Display Suite module.

And then set the display mode to Display Suite from Content

1
  • I didn't have to create the node display with DS, it was good as it is. The only thing I had to do is turn on DS and switch the view format to Display Suite and not Comment. I still had to turn on display comments in the Display Suite format settings, but it worked. Jul 31, 2013 at 11:33
0

try this:

Usually the comment are displayed in the "Links" display. Go to your content type and in Manage display tab, make sure that you have the "Links" field enabled. If so, you sould have something like this in your views (after saving):

Read more | "TITLE OF THE NODE" | 2 comments("x comments") | Add new comment

2
  • There is no Links field in Manage display tab Jul 30, 2013 at 11:39
  • I can enable the 'Display Links' on the view row settings, but that doesnt list the comments. 'Display Comments' doesnt work Jul 30, 2013 at 11:43
0

Node comments will not show up as you are displaying fields instead of Nodes (named Content in Views). The setting display comments is in effect when you show Content in Views.

If you switch to show: Content instead of Fields you get the line saying something like "1 comment Add new comment".

If you still want to use fields to display your data I suggest you add the fields Content: Add comment link and Content: Comment count to create your own comment information to the node.

2
  • I'm using Content in the second view display, but fields on the first and the problem is with the second view display. Sorry if I didn't make that clearer. Jul 31, 2013 at 11:30
  • Aha, I see now what you mean. Jul 31, 2013 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.