node.views_template.inc 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?php
  2. /**
  3. * @file
  4. * Contains views templates on behalf of the node module.
  5. */
  6. function node_views_templates() {
  7. // Only the standard install profile has the image field provided so only show it for it.
  8. if (variable_get('install_profile', 'standard') != 'standard') {
  9. return array();
  10. }
  11. $view = new view;
  12. $view->name = 'image_gallery';
  13. $view->description = 'Shows all images which was uploaded on the "field_image" field';
  14. $view->tag = '';
  15. $view->base_table = 'node';
  16. $view->human_name = 'Image Gallery';
  17. $view->core = 7;
  18. $view->api_version = '3.0';
  19. $view->disabled = TRUE; /* Edit this to true to make a default view disabled initially */
  20. /* Display: Defaults */
  21. $handler = $view->new_display('default', 'Defaults', 'default');
  22. $handler->display->display_options['title'] = 'Image gallery';
  23. $handler->display->display_options['access']['type'] = 'perm';
  24. $handler->display->display_options['cache']['type'] = 'none';
  25. $handler->display->display_options['query']['type'] = 'views_query';
  26. $handler->display->display_options['exposed_form']['type'] = 'basic';
  27. $handler->display->display_options['pager']['type'] = 'full';
  28. $handler->display->display_options['pager']['options']['items_per_page'] = '24';
  29. $handler->display->display_options['pager']['options']['offset'] = '0';
  30. $handler->display->display_options['pager']['options']['id'] = '0';
  31. $handler->display->display_options['pager']['options']['expose']['items_per_page_options_all'] = 0;
  32. $handler->display->display_options['style_plugin'] = 'grid';
  33. $handler->display->display_options['style_options']['fill_single_line'] = 1;
  34. $handler->display->display_options['row_plugin'] = 'fields';
  35. /* Field: Content: Image */
  36. $handler->display->display_options['fields']['field_image']['id'] = 'field_image';
  37. $handler->display->display_options['fields']['field_image']['table'] = 'field_data_field_image';
  38. $handler->display->display_options['fields']['field_image']['field'] = 'field_image';
  39. $handler->display->display_options['fields']['field_image']['label'] = '';
  40. $handler->display->display_options['fields']['field_image']['alter']['alter_text'] = 0;
  41. $handler->display->display_options['fields']['field_image']['alter']['make_link'] = 0;
  42. $handler->display->display_options['fields']['field_image']['alter']['absolute'] = 0;
  43. $handler->display->display_options['fields']['field_image']['alter']['external'] = 0;
  44. $handler->display->display_options['fields']['field_image']['alter']['trim'] = 0;
  45. $handler->display->display_options['fields']['field_image']['alter']['nl2br'] = 0;
  46. $handler->display->display_options['fields']['field_image']['alter']['word_boundary'] = 1;
  47. $handler->display->display_options['fields']['field_image']['alter']['ellipsis'] = 1;
  48. $handler->display->display_options['fields']['field_image']['alter']['strip_tags'] = 0;
  49. $handler->display->display_options['fields']['field_image']['alter']['html'] = 0;
  50. $handler->display->display_options['fields']['field_image']['element_label_colon'] = 1;
  51. $handler->display->display_options['fields']['field_image']['element_default_classes'] = 1;
  52. $handler->display->display_options['fields']['field_image']['hide_empty'] = 0;
  53. $handler->display->display_options['fields']['field_image']['empty_zero'] = 0;
  54. $handler->display->display_options['fields']['field_image']['click_sort_column'] = 'fid';
  55. $handler->display->display_options['fields']['field_image']['settings'] = array(
  56. 'image_style' => 'thumbnail',
  57. 'image_link' => 'content',
  58. );
  59. $handler->display->display_options['fields']['field_image']['field_api_classes'] = 0;
  60. /* Field: User: Name */
  61. $handler->display->display_options['fields']['name']['id'] = 'name';
  62. $handler->display->display_options['fields']['name']['table'] = 'users';
  63. $handler->display->display_options['fields']['name']['field'] = 'name';
  64. $handler->display->display_options['fields']['name']['label'] = 'Author';
  65. $handler->display->display_options['fields']['name']['alter']['alter_text'] = 0;
  66. $handler->display->display_options['fields']['name']['alter']['make_link'] = 0;
  67. $handler->display->display_options['fields']['name']['alter']['absolute'] = 0;
  68. $handler->display->display_options['fields']['name']['alter']['external'] = 0;
  69. $handler->display->display_options['fields']['name']['alter']['trim'] = 0;
  70. $handler->display->display_options['fields']['name']['alter']['nl2br'] = 0;
  71. $handler->display->display_options['fields']['name']['alter']['word_boundary'] = 1;
  72. $handler->display->display_options['fields']['name']['alter']['ellipsis'] = 1;
  73. $handler->display->display_options['fields']['name']['alter']['strip_tags'] = 0;
  74. $handler->display->display_options['fields']['name']['alter']['html'] = 0;
  75. $handler->display->display_options['fields']['name']['element_label_colon'] = 1;
  76. $handler->display->display_options['fields']['name']['element_default_classes'] = 1;
  77. $handler->display->display_options['fields']['name']['hide_empty'] = 0;
  78. $handler->display->display_options['fields']['name']['empty_zero'] = 0;
  79. $handler->display->display_options['fields']['name']['link_to_user'] = 1;
  80. $handler->display->display_options['fields']['name']['overwrite_anonymous'] = 0;
  81. /* Contextual filter: Content: Has taxonomy term ID */
  82. $handler->display->display_options['arguments']['tid']['id'] = 'tid';
  83. $handler->display->display_options['arguments']['tid']['table'] = 'taxonomy_index';
  84. $handler->display->display_options['arguments']['tid']['field'] = 'tid';
  85. $handler->display->display_options['arguments']['tid']['default_action'] = 'summary';
  86. $handler->display->display_options['arguments']['tid']['default_argument_type'] = 'fixed';
  87. $handler->display->display_options['arguments']['tid']['default_argument_skip_url'] = 0;
  88. $handler->display->display_options['arguments']['tid']['summary']['number_of_records'] = '1';
  89. $handler->display->display_options['arguments']['tid']['summary']['format'] = 'unformatted_summary';
  90. $handler->display->display_options['arguments']['tid']['summary_options']['items_per_page'] = '25';
  91. $handler->display->display_options['arguments']['tid']['summary_options']['inline'] = 0;
  92. $handler->display->display_options['arguments']['tid']['break_phrase'] = 0;
  93. $handler->display->display_options['arguments']['tid']['add_table'] = 0;
  94. $handler->display->display_options['arguments']['tid']['require_value'] = 0;
  95. $handler->display->display_options['arguments']['tid']['reduce_duplicates'] = 0;
  96. $handler->display->display_options['arguments']['tid']['set_breadcrumb'] = 0;
  97. /* Filter criterion: Content: Image (field_image) - fid */
  98. $handler->display->display_options['filters']['field_image_fid']['id'] = 'field_image_fid';
  99. $handler->display->display_options['filters']['field_image_fid']['table'] = 'field_data_field_image';
  100. $handler->display->display_options['filters']['field_image_fid']['field'] = 'field_image_fid';
  101. $handler->display->display_options['filters']['field_image_fid']['operator'] = 'not empty';
  102. /* Filter criterion: Content: Published */
  103. $handler->display->display_options['filters']['status']['id'] = 'status';
  104. $handler->display->display_options['filters']['status']['table'] = 'node';
  105. $handler->display->display_options['filters']['status']['field'] = 'status';
  106. $handler->display->display_options['filters']['status']['value'] = '1';
  107. /* Display: Gallery page */
  108. $handler = $view->new_display('page', 'Gallery page', 'page_1');
  109. $handler->display->display_options['path'] = 'gallery';
  110. $translatables['image_gallery'] = array(
  111. t('Defaults'),
  112. t('Image gallery'),
  113. t('more'),
  114. t('Apply'),
  115. t('Reset'),
  116. t('Sort by'),
  117. t('Asc'),
  118. t('Desc'),
  119. t('Items per page'),
  120. t('- All -'),
  121. t('Offset'),
  122. t('Author'),
  123. t('All'),
  124. t('Gallery page'),
  125. );
  126. $views[$view->name] = $view;
  127. return $views;
  128. }