1

I created a new view block and it appears in Article - Content type; In these block I want to display the author's user picture, author's username, post date, category, tags, and comment count.

I succeeded to display user picture, username, but the post date, category, tags, and comment count are from the other article (the first or the last article written by the same author).

I used a few relationships and contextual filters, without success.

Example

I have an article with title "One two three", category numerals, tags "one, two, three, numeral". When someone reads these article, I want that block to show these values:

  • Category: numerals
  • Tags: one, two, three, numeral
  • username
  • user picture

Is it possible to display all these things in one view?

3

There was a recent answer very much along these lines here that recommended the module Author Pane. This module is extensible with hooks; might be the easier way for you to go as well.

Author Pane is a block of information about a given user, like those typically found on a forum post, but can be used in other places as well. From core, it collects the user picture, name, join date, online status, contact link, and profile information. In addition, any module or theme can feed it more information via the preprocess system. All of this information is then gathered and displayed using a template file.

  • Author Pane isn't useful for me. I installed EVA module, but I need to document about this. – Ionut Adrian Luchian Jan 6 '12 at 12:05
1

Have you tried using the Taxonomy : All Terms along with the Limit terms by vocabulary constraint? That can be used to display all the Tags.

-2

You need the Chaos tool suite, Views and Quick Tabs modules. Under Chaos tool suite module enable Chaos tools, Page manager and Views content panes; under Views module enable Views and Views UI.

  • Go to Structure/Views (admin/structure/views); click "Add a new view"; give a name and don't select "Create a page" or "Create a block" and click "Continue & edit".
  • Remove "Content: Post date (desc)" from Sort criteria.
  • Under Contextual Filters add "Content: Nid"; under "When the filter Value is not available", select "Provide default value, Type - Content ID from URL"; under "When the filter value is available or a default is provided" select "Specify validation criteria", "Validator - Content", under "Content types" select "Article", and then click "Apply (all displays)."
  • Remove "Content: Title from fields" and add "Content: Tags (Tags)", "Content: Category (Category)", "Content: Comment count (Comments)" and "Content statistics: Total views (Total views)".
  • Under "Relationships" add "Content: Author", and check "Require this relationship"; click "Apply (all displays)".
  • Under "Fields", add "(author) User: Name" and "(author) User: Picture".
  • Under "Pager", click on "Full" and "Display a specified number of items"; click "Apply". At "Items to display" set 1; click "Apply".
  • Then you need to add a display to this view: click on "Add button" and select "Content pane".
  • Under "Pane settings", click "Edit" at "Argument input"; at "Content: Nid source", select "From context"; at "Required context", select "Content ID" and check "Context is optional"; click on "Apply".
  • Go to Structure/Quicktabs, click on "Add Quicktabs Instance", and scroll down; you'll find a table. At "Tab type", select "view"; at "Select a view", choose the view you created; at display select *"panel_pane_1: Content pane"*; give a name in "Tab title", and click on "Save".
  • Go to Structure/Blocks (admin/structure/block) find your quick tab block, and put it in articles pages.

Now play with CSS.

Here is my view export:

$view = new view;
$view->name = 'info_about_the_current_article_w';
$view->description = 'I try to create a custom content pane (block) that display the information about who written the article that is viewed, etc.';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Info about the current article when is viewed';
$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['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['query']['options']['query_comment'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '1';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Relationship: Content: Author */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] = 'node';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';
$handler->display->display_options['relationships']['uid']['required'] = 1;
/* Field: Content: Tags */
$handler->display->display_options['fields']['field_tags']['id'] = 'field_tags';
$handler->display->display_options['fields']['field_tags']['table'] = 'field_data_field_tags';
$handler->display->display_options['fields']['field_tags']['field'] = 'field_tags';
$handler->display->display_options['fields']['field_tags']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_tags']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_tags']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_tags']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_tags']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_tags']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_tags']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_tags']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_tags']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_tags']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_tags']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_tags']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_tags']['element_label_colon'] = 1;
$handler->display->display_options['fields']['field_tags']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_tags']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_tags']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_tags']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['field_tags']['group_rows'] = 1;
$handler->display->display_options['fields']['field_tags']['delta_offset'] = '0';
$handler->display->display_options['fields']['field_tags']['delta_reversed'] = 0;
$handler->display->display_options['fields']['field_tags']['delta_first_last'] = 0;
$handler->display->display_options['fields']['field_tags']['field_api_classes'] = 0;
/* Field: Content: Category */
$handler->display->display_options['fields']['field_categories']['id'] = 'field_categories';
$handler->display->display_options['fields']['field_categories']['table'] = 'field_data_field_categories';
$handler->display->display_options['fields']['field_categories']['field'] = 'field_categories';
$handler->display->display_options['fields']['field_categories']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_categories']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_categories']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_categories']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_categories']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_categories']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_categories']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_categories']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_categories']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_categories']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_categories']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_categories']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_categories']['element_label_colon'] = 1;
$handler->display->display_options['fields']['field_categories']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_categories']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_categories']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_categories']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['field_categories']['field_api_classes'] = 0;
/* Field: Content: Comment count */
$handler->display->display_options['fields']['comment_count']['id'] = 'comment_count';
$handler->display->display_options['fields']['comment_count']['table'] = 'node_comment_statistics';
$handler->display->display_options['fields']['comment_count']['field'] = 'comment_count';
$handler->display->display_options['fields']['comment_count']['label'] = 'Comments';
$handler->display->display_options['fields']['comment_count']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['comment_count']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['comment_count']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['comment_count']['alter']['external'] = 0;
$handler->display->display_options['fields']['comment_count']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['comment_count']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['comment_count']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['comment_count']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['comment_count']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['comment_count']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['comment_count']['alter']['trim'] = 0;
$handler->display->display_options['fields']['comment_count']['alter']['html'] = 0;
$handler->display->display_options['fields']['comment_count']['element_label_colon'] = 1;
$handler->display->display_options['fields']['comment_count']['element_default_classes'] = 1;
$handler->display->display_options['fields']['comment_count']['empty'] = '0';
$handler->display->display_options['fields']['comment_count']['hide_empty'] = 0;
$handler->display->display_options['fields']['comment_count']['empty_zero'] = 0;
$handler->display->display_options['fields']['comment_count']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['comment_count']['separator'] = '';
$handler->display->display_options['fields']['comment_count']['format_plural'] = 0;
/* Field: Content statistics: Total views */
$handler->display->display_options['fields']['totalcount']['id'] = 'totalcount';
$handler->display->display_options['fields']['totalcount']['table'] = 'node_counter';
$handler->display->display_options['fields']['totalcount']['field'] = 'totalcount';
$handler->display->display_options['fields']['totalcount']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['totalcount']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['totalcount']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['totalcount']['alter']['external'] = 0;
$handler->display->display_options['fields']['totalcount']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['totalcount']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['totalcount']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['totalcount']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['totalcount']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['totalcount']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['totalcount']['alter']['trim'] = 0;
$handler->display->display_options['fields']['totalcount']['alter']['html'] = 0;
$handler->display->display_options['fields']['totalcount']['element_label_colon'] = 1;
$handler->display->display_options['fields']['totalcount']['element_default_classes'] = 1;
$handler->display->display_options['fields']['totalcount']['empty'] = '0';
$handler->display->display_options['fields']['totalcount']['hide_empty'] = 0;
$handler->display->display_options['fields']['totalcount']['empty_zero'] = 0;
$handler->display->display_options['fields']['totalcount']['hide_alter_empty'] = 0;
$handler->display->display_options['fields']['totalcount']['separator'] = '';
$handler->display->display_options['fields']['totalcount']['format_plural'] = 0;
/* Field: User: Name */
$handler->display->display_options['fields']['name']['id'] = 'name';
$handler->display->display_options['fields']['name']['table'] = 'users';
$handler->display->display_options['fields']['name']['field'] = 'name';
$handler->display->display_options['fields']['name']['relationship'] = 'uid';
$handler->display->display_options['fields']['name']['label'] = '';
$handler->display->display_options['fields']['name']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['name']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['name']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['name']['alter']['external'] = 0;
$handler->display->display_options['fields']['name']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['name']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['name']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['name']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['name']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['name']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['name']['alter']['trim'] = 0;
$handler->display->display_options['fields']['name']['alter']['html'] = 0;
$handler->display->display_options['fields']['name']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['name']['element_default_classes'] = 1;
$handler->display->display_options['fields']['name']['hide_empty'] = 0;
$handler->display->display_options['fields']['name']['empty_zero'] = 0;
$handler->display->display_options['fields']['name']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['name']['link_to_user'] = 1;
$handler->display->display_options['fields']['name']['overwrite_anonymous'] = 0;
$handler->display->display_options['fields']['name']['format_username'] = 1;
/* Field: User: Picture */
$handler->display->display_options['fields']['picture']['id'] = 'picture';
$handler->display->display_options['fields']['picture']['table'] = 'users';
$handler->display->display_options['fields']['picture']['field'] = 'picture';
$handler->display->display_options['fields']['picture']['relationship'] = 'uid';
$handler->display->display_options['fields']['picture']['label'] = '';
$handler->display->display_options['fields']['picture']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['picture']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['picture']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['picture']['alter']['external'] = 0;
$handler->display->display_options['fields']['picture']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['picture']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['picture']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['picture']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['picture']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['picture']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['picture']['alter']['trim'] = 0;
$handler->display->display_options['fields']['picture']['alter']['html'] = 0;
$handler->display->display_options['fields']['picture']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['picture']['element_default_classes'] = 1;
$handler->display->display_options['fields']['picture']['hide_empty'] = 0;
$handler->display->display_options['fields']['picture']['empty_zero'] = 0;
$handler->display->display_options['fields']['picture']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['picture']['link_photo_to_profile'] = 1;
$handler->display->display_options['fields']['picture']['image_style'] = 'thumbnail';
/* Contextual filter: Content: Nid */
$handler->display->display_options['arguments']['nid']['id'] = 'nid';
$handler->display->display_options['arguments']['nid']['table'] = 'node';
$handler->display->display_options['arguments']['nid']['field'] = 'nid';
$handler->display->display_options['arguments']['nid']['default_action'] = 'default';
$handler->display->display_options['arguments']['nid']['default_argument_type'] = 'node';
$handler->display->display_options['arguments']['nid']['default_argument_skip_url'] = 0;
$handler->display->display_options['arguments']['nid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['nid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['nid']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['nid']['specify_validation'] = 1;
$handler->display->display_options['arguments']['nid']['validate']['type'] = 'node';
$handler->display->display_options['arguments']['nid']['validate_options']['types'] = array(
  'article' => 'article',
);
$handler->display->display_options['arguments']['nid']['validate_options']['access'] = 0;
$handler->display->display_options['arguments']['nid']['break_phrase'] = 0;
$handler->display->display_options['arguments']['nid']['not'] = 0;
/* 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'] = 0;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;

/* Display: Content pane */
$handler = $view->new_display('panel_pane', 'Content pane', 'panel_pane_1');
$handler->display->display_options['argument_input'] = array(
  'nid' => array(
    'type' => 'context',
    'context' => 'entity:node.nid',
    'context_optional' => 1,
    'panel' => '0',
    'fixed' => '',
    'label' => 'Content: Nid',
  ),
  'uid' => array(
    'type' => 'context',
    'context' => 'entity:user.uid',
    'context_optional' => 1,
    'panel' => '0',
    'fixed' => '',
    'label' => 'Content: Author uid',
  ),
);

I found an easier way to do that: Install the Display suite module; you can watch this screencast made by swentel on Youtube.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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