Posted By

zachharkey on 09/22/11


Tagged


Versions (?)

Blog View


 / Published in: PHP
 

  1. $view = new view;
  2. $view->name = 'blog';
  3. $view->description = '';
  4. $view->tag = '';
  5. $view->view_php = '';
  6. $view->base_table = 'node';
  7. $view->is_cacheable = FALSE;
  8. $view->api_version = 2;
  9. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  10. $handler = $view->new_display('default', 'Defaults', 'default');
  11. $handler->override_option('relationships', array(
  12. 'uid' => array(
  13. 'label' => 'user',
  14. 'required' => 0,
  15. 'id' => 'uid',
  16. 'table' => 'node_revisions',
  17. 'field' => 'uid',
  18. 'override' => array(
  19. 'button' => 'Override',
  20. ),
  21. 'relationship' => 'none',
  22. ),
  23. ));
  24. $handler->override_option('fields', array(
  25. 'title' => array(
  26. 'label' => '',
  27. 'alter' => array(
  28. 'alter_text' => 1,
  29. 'text' => '<h2>[title]</h2>',
  30. 'make_link' => 0,
  31. 'path' => '',
  32. 'alt' => '',
  33. 'prefix' => '',
  34. 'suffix' => '',
  35. 'help' => '',
  36. 'trim' => 0,
  37. 'max_length' => '',
  38. 'word_boundary' => 1,
  39. 'ellipsis' => 1,
  40. 'strip_tags' => 0,
  41. 'html' => 0,
  42. ),
  43. 'link_to_node' => 0,
  44. 'exclude' => 0,
  45. 'id' => 'title',
  46. 'table' => 'node',
  47. 'field' => 'title',
  48. 'override' => array(
  49. 'button' => 'Override',
  50. ),
  51. 'relationship' => 'none',
  52. ),
  53. 'created' => array(
  54. 'label' => '',
  55. 'alter' => array(
  56. 'alter_text' => 0,
  57. 'text' => '',
  58. 'make_link' => 0,
  59. 'path' => '',
  60. 'alt' => '',
  61. 'prefix' => '',
  62. 'suffix' => '',
  63. 'help' => '',
  64. 'trim' => 0,
  65. 'max_length' => '',
  66. 'word_boundary' => 1,
  67. 'ellipsis' => 1,
  68. 'strip_tags' => 0,
  69. 'html' => 0,
  70. ),
  71. 'date_format' => 'small',
  72. 'custom_date_format' => '',
  73. 'exclude' => 0,
  74. 'id' => 'created',
  75. 'table' => 'node',
  76. 'field' => 'created',
  77. 'override' => array(
  78. 'button' => 'Override',
  79. ),
  80. 'relationship' => 'none',
  81. ),
  82. 'edit_node' => array(
  83. 'label' => '',
  84. 'alter' => array(
  85. 'alter_text' => 0,
  86. 'text' => '',
  87. 'make_link' => 0,
  88. 'path' => '',
  89. 'alt' => '',
  90. 'prefix' => '',
  91. 'suffix' => '',
  92. 'help' => '',
  93. 'trim' => 0,
  94. 'max_length' => '',
  95. 'word_boundary' => 1,
  96. 'ellipsis' => 1,
  97. 'strip_tags' => 0,
  98. 'html' => 0,
  99. ),
  100. 'text' => '',
  101. 'exclude' => 0,
  102. 'id' => 'edit_node',
  103. 'table' => 'node',
  104. 'field' => 'edit_node',
  105. 'override' => array(
  106. 'button' => 'Override',
  107. ),
  108. 'relationship' => 'none',
  109. ),
  110. 'body' => array(
  111. 'label' => '',
  112. 'alter' => array(
  113. 'alter_text' => 0,
  114. 'text' => '',
  115. 'make_link' => 0,
  116. 'path' => '',
  117. 'alt' => '',
  118. 'prefix' => '',
  119. 'suffix' => '',
  120. 'help' => '',
  121. 'trim' => 0,
  122. 'max_length' => '',
  123. 'word_boundary' => 1,
  124. 'ellipsis' => 1,
  125. 'strip_tags' => 0,
  126. 'html' => 0,
  127. ),
  128. 'exclude' => 0,
  129. 'id' => 'body',
  130. 'table' => 'node_revisions',
  131. 'field' => 'body',
  132. 'override' => array(
  133. 'button' => 'Override',
  134. ),
  135. 'relationship' => 'none',
  136. ),
  137. ));
  138. $handler->override_option('sorts', array(
  139. 'created' => array(
  140. 'order' => 'DESC',
  141. 'granularity' => 'day',
  142. 'id' => 'created',
  143. 'table' => 'node',
  144. 'field' => 'created',
  145. 'relationship' => 'none',
  146. ),
  147. ));
  148. $handler->override_option('arguments', array(
  149. 'uid' => array(
  150. 'default_action' => 'ignore',
  151. 'style_plugin' => 'default_summary',
  152. 'style_options' => array(),
  153. 'wildcard' => 'all',
  154. 'wildcard_substitution' => 'All',
  155. 'title' => '',
  156. 'breadcrumb' => '',
  157. 'default_argument_type' => 'fixed',
  158. 'default_argument' => '',
  159. 'validate_type' => 'none',
  160. 'validate_fail' => 'not found',
  161. 'break_phrase' => 0,
  162. 'not' => 0,
  163. 'id' => 'uid',
  164. 'table' => 'users',
  165. 'field' => 'uid',
  166. 'validate_user_argument_type' => 'uid',
  167. 'validate_user_roles' => array(
  168. '2' => 0,
  169. '5' => 0,
  170. '3' => 0,
  171. ),
  172. 'override' => array(
  173. 'button' => 'Override',
  174. ),
  175. 'relationship' => 'none',
  176. 'default_options_div_prefix' => '',
  177. 'default_argument_user' => 0,
  178. 'default_argument_fixed' => '',
  179. 'default_argument_php' => '',
  180. 'validate_argument_node_type' => array(
  181. 'webform' => 0,
  182. 'product' => 0,
  183. 'capsule' => 0,
  184. 'feature' => 0,
  185. 'page' => 0,
  186. 'post' => 0,
  187. 'press' => 0,
  188. 'scene' => 0,
  189. 'showcase' => 0,
  190. 'story' => 0,
  191. ),
  192. 'validate_argument_node_access' => 0,
  193. 'validate_argument_nid_type' => 'nid',
  194. 'validate_argument_vocabulary' => array(
  195. '8' => 0,
  196. '7' => 0,
  197. '9' => 0,
  198. ),
  199. 'validate_argument_type' => 'tid',
  200. 'validate_argument_transform' => 0,
  201. 'validate_user_restrict_roles' => 0,
  202. 'validate_argument_php' => '',
  203. ),
  204. ));
  205. $handler->override_option('filters', array(
  206. 'type' => array(
  207. 'operator' => 'in',
  208. 'value' => array(
  209. 'post' => 'post',
  210. ),
  211. 'group' => '0',
  212. 'exposed' => FALSE,
  213. 'expose' => array(
  214. 'operator' => FALSE,
  215. 'label' => '',
  216. ),
  217. 'id' => 'type',
  218. 'table' => 'node',
  219. 'field' => 'type',
  220. 'override' => array(
  221. 'button' => 'Override',
  222. ),
  223. 'relationship' => 'none',
  224. ),
  225. ));
  226. $handler->override_option('access', array(
  227. 'type' => 'none',
  228. ));
  229. $handler->override_option('cache', array(
  230. 'type' => 'none',
  231. ));
  232. $handler->override_option('title', 'Blog');
  233. $handler->override_option('use_pager', '1');
  234. $handler->override_option('pager_element', 1);
  235. $handler->override_option('distinct', 1);
  236. $handler->override_option('row_plugin', 'node');
  237. $handler->override_option('row_options', array(
  238. 'relationship' => 'none',
  239. 'build_mode' => 'teaser',
  240. 'links' => 1,
  241. 'comments' => 0,
  242. ));
  243. $handler = $view->new_display('panel_pane', 'Main', 'panel_pane_1');
  244. $handler->override_option('pane_title', 'Blog - Main');
  245. $handler->override_option('pane_description', '');
  246. $handler->override_option('pane_category', array(
  247. 'name' => 'View panes',
  248. 'weight' => 0,
  249. ));
  250. $handler->override_option('allow', array(
  251. 'use_pager' => 'use_pager',
  252. 'items_per_page' => 'items_per_page',
  253. 'offset' => 'offset',
  254. 'link_to_view' => 'link_to_view',
  255. 'more_link' => 'more_link',
  256. 'path_override' => 'path_override',
  257. 'title_override' => 'title_override',
  258. 'exposed_form' => FALSE,
  259. 'fields_override' => FALSE,
  260. ));
  261. $handler->override_option('argument_input', array(
  262. 'uid' => array(
  263. 'type' => 'panel',
  264. 'context' => 'term.description',
  265. 'context_optional' => 0,
  266. 'panel' => '0',
  267. 'fixed' => '',
  268. 'label' => 'User: Uid',
  269. ),
  270. ));
  271. $handler->override_option('link_to_view', 0);
  272. $handler->override_option('inherit_panels_path', '1');
  273. $handler = $view->new_display('feed', 'Feed', 'feed_1');
  274. $handler->override_option('style_plugin', 'rss');
  275. $handler->override_option('style_options', array(
  276. 'mission_description' => FALSE,
  277. 'description' => '',
  278. ));
  279. $handler->override_option('row_plugin', 'node_rss');
  280. $handler->override_option('row_options', array(
  281. 'relationship' => 'none',
  282. 'item_length' => 'fulltext',
  283. ));
  284. $handler->override_option('path', 'blog/%/rss.xml');
  285. $handler->override_option('menu', array(
  286. 'type' => 'none',
  287. 'title' => '',
  288. 'description' => '',
  289. 'weight' => 0,
  290. 'name' => 'navigation',
  291. ));
  292. $handler->override_option('tab_options', array(
  293. 'type' => 'none',
  294. 'title' => '',
  295. 'description' => '',
  296. 'weight' => 0,
  297. 'name' => 'navigation',
  298. ));
  299. $handler->override_option('displays', array(
  300. 'panel_pane_1' => 'panel_pane_1',
  301. 'default' => 0,
  302. ));
  303. $handler->override_option('sitename_title', FALSE);
  304.  

Report this snippet  

You need to login to post a comment.