SHARE
TWEET

Drupal Views Block

a guest Apr 21st, 2015 229 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $view = new view();
  2. $view->name = 'listing_offers';
  3. $view->description = '';
  4. $view->tag = 'default';
  5. $view->base_table = 'node';
  6. $view->human_name = 'Listing Offers';
  7. $view->core = 7;
  8. $view->api_version = '3.0';
  9. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  10.  
  11. /* Display: Master */
  12. $handler = $view->new_display('default', 'Master', 'default');
  13. $handler->display->display_options['title'] = 'Offers';
  14. $handler->display->display_options['use_more_always'] = FALSE;
  15. $handler->display->display_options['access']['type'] = 'perm';
  16. $handler->display->display_options['cache']['type'] = 'none';
  17. $handler->display->display_options['query']['type'] = 'views_query';
  18. $handler->display->display_options['exposed_form']['type'] = 'basic';
  19. $handler->display->display_options['pager']['type'] = 'full';
  20. $handler->display->display_options['pager']['options']['items_per_page'] = '5';
  21. $handler->display->display_options['style_plugin'] = 'table';
  22. /* Relationship: Entity Reference: Referenced Entity */
  23. $handler->display->display_options['relationships']['field_listing_target_id']['id'] = 'field_listing_target_id';
  24. $handler->display->display_options['relationships']['field_listing_target_id']['table'] = 'field_data_field_listing';
  25. $handler->display->display_options['relationships']['field_listing_target_id']['field'] = 'field_listing_target_id';
  26. $handler->display->display_options['relationships']['field_listing_target_id']['required'] = TRUE;
  27. /* Relationship: Content: Author */
  28. $handler->display->display_options['relationships']['uid']['id'] = 'uid';
  29. $handler->display->display_options['relationships']['uid']['table'] = 'node';
  30. $handler->display->display_options['relationships']['uid']['field'] = 'uid';
  31. $handler->display->display_options['relationships']['uid']['relationship'] = 'field_listing_target_id';
  32. $handler->display->display_options['relationships']['uid']['label'] = 'listing_author';
  33. $handler->display->display_options['relationships']['uid']['required'] = TRUE;
  34. /* Relationship: Content: Author */
  35. $handler->display->display_options['relationships']['uid_1']['id'] = 'uid_1';
  36. $handler->display->display_options['relationships']['uid_1']['table'] = 'node';
  37. $handler->display->display_options['relationships']['uid_1']['field'] = 'uid';
  38. $handler->display->display_options['relationships']['uid_1']['label'] = 'offer_author';
  39. $handler->display->display_options['relationships']['uid_1']['required'] = TRUE;
  40. /* Field: User: Name */
  41. $handler->display->display_options['fields']['name']['id'] = 'name';
  42. $handler->display->display_options['fields']['name']['table'] = 'users';
  43. $handler->display->display_options['fields']['name']['field'] = 'name';
  44. $handler->display->display_options['fields']['name']['relationship'] = 'uid';
  45. $handler->display->display_options['fields']['name']['label'] = 'From';
  46. /* Field: Content: Body */
  47. $handler->display->display_options['fields']['body']['id'] = 'body';
  48. $handler->display->display_options['fields']['body']['table'] = 'field_data_body';
  49. $handler->display->display_options['fields']['body']['field'] = 'body';
  50. $handler->display->display_options['fields']['body']['label'] = 'Message';
  51. $handler->display->display_options['fields']['body']['type'] = 'text_plain';
  52. /* Sort criterion: Content: Post date */
  53. $handler->display->display_options['sorts']['created']['id'] = 'created';
  54. $handler->display->display_options['sorts']['created']['table'] = 'node';
  55. $handler->display->display_options['sorts']['created']['field'] = 'created';
  56. /* Contextual filter: Content: Nid */
  57. $handler->display->display_options['arguments']['nid']['id'] = 'nid';
  58. $handler->display->display_options['arguments']['nid']['table'] = 'node';
  59. $handler->display->display_options['arguments']['nid']['field'] = 'nid';
  60. $handler->display->display_options['arguments']['nid']['relationship'] = 'field_listing_target_id';
  61. $handler->display->display_options['arguments']['nid']['default_action'] = 'default';
  62. $handler->display->display_options['arguments']['nid']['default_argument_type'] = 'node';
  63. $handler->display->display_options['arguments']['nid']['summary']['number_of_records'] = '0';
  64. $handler->display->display_options['arguments']['nid']['summary']['format'] = 'default_summary';
  65. $handler->display->display_options['arguments']['nid']['summary_options']['items_per_page'] = '25';
  66. $handler->display->display_options['filter_groups']['groups'] = array(
  67.   1 => 'AND',
  68.   2 => 'OR',
  69. );
  70. /* Filter criterion: Content: Published or admin */
  71. $handler->display->display_options['filters']['status_extra']['id'] = 'status_extra';
  72. $handler->display->display_options['filters']['status_extra']['table'] = 'node';
  73. $handler->display->display_options['filters']['status_extra']['field'] = 'status_extra';
  74. $handler->display->display_options['filters']['status_extra']['group'] = 1;
  75. /* Filter criterion: Content: Type */
  76. $handler->display->display_options['filters']['type']['id'] = 'type';
  77. $handler->display->display_options['filters']['type']['table'] = 'node';
  78. $handler->display->display_options['filters']['type']['field'] = 'type';
  79. $handler->display->display_options['filters']['type']['value'] = array(
  80.   'offer' => 'offer',
  81. );
  82. $handler->display->display_options['filters']['type']['group'] = 1;
  83. /* Filter criterion: User: Name */
  84. $handler->display->display_options['filters']['uid']['id'] = 'uid';
  85. $handler->display->display_options['filters']['uid']['table'] = 'users';
  86. $handler->display->display_options['filters']['uid']['field'] = 'uid';
  87. $handler->display->display_options['filters']['uid']['relationship'] = 'uid';
  88. $handler->display->display_options['filters']['uid']['operator'] = 'not empty';
  89. $handler->display->display_options['filters']['uid']['value'] = '';
  90. $handler->display->display_options['filters']['uid']['group'] = 2;
  91. /* Filter criterion: User: Current */
  92. $handler->display->display_options['filters']['uid_current']['id'] = 'uid_current';
  93. $handler->display->display_options['filters']['uid_current']['table'] = 'users';
  94. $handler->display->display_options['filters']['uid_current']['field'] = 'uid_current';
  95. $handler->display->display_options['filters']['uid_current']['relationship'] = 'uid_1';
  96. $handler->display->display_options['filters']['uid_current']['value'] = '1';
  97. $handler->display->display_options['filters']['uid_current']['group'] = 2;
  98.  
  99. /* Display: Block */
  100. $handler = $view->new_display('block', 'Block', 'block');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top