Drupal视图创建类别术语列表

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Drupal视图创建类别术语列表相关的知识,希望对你有一定的参考价值。

Creates a category list showing the number of posts in each category similar to some blogging platforms. The view exposes a block and page.
  1. $view = new stdClass();
  2. $view->name = 'Categories';
  3. $view->description = 'List of categories with number of articles posted in each category.';
  4. $view->access = array (
  5. 0 => '1',
  6. 1 => '2',
  7. );
  8. $view->view_args_php = '';
  9. $view->page = TRUE;
  10. $view->page_title = 'Browse Articles';
  11. $view->page_header = 'Browse articles by category.';
  12. $view->page_header_format = '1';
  13. $view->page_footer = '';
  14. $view->page_footer_format = '1';
  15. $view->page_empty = '';
  16. $view->page_empty_format = '1';
  17. $view->page_type = 'teaser';
  18. $view->url = 'articles';
  19. $view->use_pager = TRUE;
  20. $view->nodes_per_page = '100';
  21. $view->block = TRUE;
  22. $view->block_title = 'Categories';
  23. $view->block_header = '';
  24. $view->block_header_format = '1';
  25. $view->block_footer = '';
  26. $view->block_footer_format = '1';
  27. $view->block_empty = '';
  28. $view->block_empty_format = '1';
  29. $view->block_type = 'list';
  30. $view->nodes_per_block = '25';
  31. $view->block_more = TRUE;
  32. $view->block_use_page_header = FALSE;
  33. $view->block_use_page_footer = FALSE;
  34. $view->block_use_page_empty = FALSE;
  35. $view->sort = array (
  36. );
  37. $view->argument = array (
  38. 'type' => 'taxletter',
  39. 'argdefault' => '6',
  40. 'title' => '%1',
  41. 'options' => '',
  42. 'wildcard' => '',
  43. 'wildcard_substitution' => '',
  44. ),
  45. );
  46. $view->field = array (
  47. 'tablename' => 'node',
  48. 'field' => 'title',
  49. 'label' => '',
  50. 'handler' => 'views_handler_field_nodelink',
  51. 'sortable' => '1',
  52. 'options' => 'link',
  53. ),
  54. );
  55. $view->filter = array (
  56. 'tablename' => 'node',
  57. 'field' => 'status',
  58. 'operator' => '=',
  59. 'options' => '',
  60. 'value' => '1',
  61. ),
  62. );
  63. $view->exposed_filter = array (
  64. );
  65. $view->requires = array(node);
  66. $views[$view->name] = $view;

以上是关于Drupal视图创建类别术语列表的主要内容,如果未能解决你的问题,请参考以下文章

Drupal 7 在视图中获取分类术语列表

按分类术语过滤的 Drupal 视图

创建一个 Drupal 视图,加载共享任何一个分类术语的所有文章(上下文过滤器)

Drupal 7 视图 - 按内容类型和分类术语分组

drupal 7 - 按分类术语分组

Drupal 6:视图:列出带有标记节点的分类术语