Drupal Views 3:在突出显示的行的上方和下方显示2行

时间:2012-07-26 13:04:38

标签: drupal views

我有一个在表格中显示内容的视图(大约30行)。我已将一个术语分配给一行(在本例中,vocab = highlight,term = yes)。我想要做的只是在突出显示的行的上方和下方显示2个结果,例如

未显示第1-3行

~~~~~~~~~~~~~~~~~~~~~~~~

第4行

第5行

第6行(突出显示=是)

第7行

第8行

~~~~~~~~~~~~~~~~~~~~~~~~

未显示9-X行

我将如何做到这一点?

谢谢,

取值

编辑:

查看以下导出:

$view = new view;
$view->name = 'league_cup_table_teaser';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'League/cup table teaser';
$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'] = 'League/cup table teaser';
$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'] = 'none';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
$handler->display->display_options['row_options']['hide_empty'] = 0;
$handler->display->display_options['row_options']['default_field_elements'] = 0;
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['title']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['title']['alter']['external'] = 0;
$handler->display->display_options['fields']['title']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['title']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['title']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = 0;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = 0;
$handler->display->display_options['fields']['title']['alter']['more_link'] = 0;
$handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title']['alter']['html'] = 0;
$handler->display->display_options['fields']['title']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['title']['element_wrapper_type'] = 'h2';
$handler->display->display_options['fields']['title']['element_default_classes'] = 1;
$handler->display->display_options['fields']['title']['hide_empty'] = 0;
$handler->display->display_options['fields']['title']['empty_zero'] = 0;
$handler->display->display_options['fields']['title']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['title']['link_to_node'] = 0;
/* Field: Content: Teams */
$handler->display->display_options['fields']['field_teams']['id'] = 'field_teams';
$handler->display->display_options['fields']['field_teams']['table'] = 'field_data_field_teams';
$handler->display->display_options['fields']['field_teams']['field'] = 'field_teams';
$handler->display->display_options['fields']['field_teams']['label'] = '';
$handler->display->display_options['fields']['field_teams']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_teams']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_teams']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_teams']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_teams']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_teams']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_teams']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_teams']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_teams']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_teams']['alter']['more_link'] = 0;
$handler->display->display_options['fields']['field_teams']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_teams']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_teams']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_teams']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_teams']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_teams']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_teams']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_teams']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['field_teams']['type'] = 'field_collection_views_view';
$handler->display->display_options['fields']['field_teams']['settings'] = array(
  'name' => 'field_collection_league_cup_table_teaser',
  'display_id' => 'default',
  'add' => '',
);
$handler->display->display_options['fields']['field_teams']['group_rows'] = 1;
$handler->display->display_options['fields']['field_teams']['delta_offset'] = '0';
$handler->display->display_options['fields']['field_teams']['delta_reversed'] = 0;
$handler->display->display_options['fields']['field_teams']['delta_first_last'] = 0;
$handler->display->display_options['fields']['field_teams']['field_api_classes'] = 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'] = 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(
  'table' => 'table',
);
/* Filter criterion: Content: Promoted to front page */
$handler->display->display_options['filters']['promote']['id'] = 'promote';
$handler->display->display_options['filters']['promote']['table'] = 'node';
$handler->display->display_options['filters']['promote']['field'] = 'promote';
$handler->display->display_options['filters']['promote']['value'] = '1';

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

1 个答案:

答案 0 :(得分:0)

你可以通过添加一层jQuery来实现。不像使用纯粹的视图那样优雅,但不过......

Dynamically hiding a portion of a HTML table

演示:http://jsbin.com/ahigi/1/edit

取值