Fix for Latest item + title list

  1. $view = new view;
  2. $view->name = 'news_block';
  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('fields', array(
  12.   'title' => array(
  13.     'label' => '',
  14.     'alter' => array(
  15.       'alter_text' => 0,
  16.       'text' => '',
  17.       'make_link' => 0,
  18.       'path' => '',
  19.       'link_class' => '',
  20.       'alt' => '',
  21.       'prefix' => '',
  22.       'suffix' => '',
  23.       'target' => '',
  24.       'help' => '',
  25.       'trim' => 0,
  26.       'max_length' => '',
  27.       'word_boundary' => 1,
  28.       'ellipsis' => 1,
  29.       'html' => 0,
  30.       'strip_tags' => 0,
  31.     ),
  32.     'empty' => '',
  33.     'hide_empty' => 0,
  34.     'empty_zero' => 0,
  35.     'link_to_node' => 1,
  36.     'exclude' => 0,
  37.     'id' => 'title',
  38.     'table' => 'node',
  39.     'field' => 'title',
  40.     'relationship' => 'none',
  41.   ),
  42.   'teaser' => array(
  43.     'label' => '',
  44.     'alter' => array(
  45.       'alter_text' => 0,
  46.       'text' => '',
  47.       'make_link' => 0,
  48.       'path' => '',
  49.       'link_class' => '',
  50.       'alt' => '',
  51.       'prefix' => '',
  52.       'suffix' => '',
  53.       'target' => '',
  54.       'help' => '',
  55.       'trim' => 0,
  56.       'max_length' => '',
  57.       'word_boundary' => 1,
  58.       'ellipsis' => 1,
  59.       'html' => 0,
  60.       'strip_tags' => 0,
  61.     ),
  62.     'empty' => '',
  63.     'hide_empty' => 0,
  64.     'empty_zero' => 0,
  65.     'exclude' => 0,
  66.     'id' => 'teaser',
  67.     'table' => 'node_revisions',
  68.     'field' => 'teaser',
  69.     'relationship' => 'none',
  70.   ),
  71. ));
  72. $handler->override_option('sorts', array(
  73.   'created' => array(
  74.     'order' => 'DESC',
  75.     'granularity' => 'second',
  76.     'id' => 'created',
  77.     'table' => 'node',
  78.     'field' => 'created',
  79.     'relationship' => 'none',
  80.   ),
  81. ));
  82. $handler->override_option('filters', array(
  83.   'type' => array(
  84.     'operator' => 'in',
  85.     'value' => array(
  86.       'story' => 'story',
  87.     ),
  88.     'group' => '0',
  89.     'exposed' => FALSE,
  90.     'expose' => array(
  91.       'operator' => FALSE,
  92.       'label' => '',
  93.     ),
  94.     'id' => 'type',
  95.     'table' => 'node',
  96.     'field' => 'type',
  97.     'relationship' => 'none',
  98.   ),
  99. ));
  100. $handler->override_option('access', array(
  101.   'type' => 'none',
  102. ));
  103. $handler->override_option('cache', array(
  104.   'type' => 'none',
  105. ));
  106. $handler = $view->new_display('block', 'Latest item', 'block_1');
  107. $handler->override_option('items_per_page', 1);
  108. $handler->override_option('block_description', '');
  109. $handler->override_option('block_caching', -1);
  110. $handler = $view->new_display('attachment', 'Attachment', 'attachment_1');
  111. $handler->override_option('fields', array(
  112.   'title' => array(
  113.     'label' => '',
  114.     'alter' => array(
  115.       'alter_text' => 0,
  116.       'text' => '',
  117.       'make_link' => 0,
  118.       'path' => '',
  119.       'link_class' => '',
  120.       'alt' => '',
  121.       'prefix' => '',
  122.       'suffix' => '',
  123.       'target' => '',
  124.       'help' => '',
  125.       'trim' => 0,
  126.       'max_length' => '',
  127.       'word_boundary' => 1,
  128.       'ellipsis' => 1,
  129.       'html' => 0,
  130.       'strip_tags' => 0,
  131.     ),
  132.     'empty' => '',
  133.     'hide_empty' => 0,
  134.     'empty_zero' => 0,
  135.     'link_to_node' => 1,
  136.     'exclude' => 0,
  137.     'id' => 'title',
  138.     'table' => 'node',
  139.     'field' => 'title',
  140.     'relationship' => 'none',
  141.   ),
  142. ));
  143. $handler->override_option('items_per_page', 4);
  144. $handler->override_option('offset', 1);
  145. $handler->override_option('attachment_position', 'after');
  146. $handler->override_option('inherit_arguments', TRUE);
  147. $handler->override_option('inherit_exposed_filters', FALSE);
  148. $handler->override_option('inherit_pager', FALSE);
  149. $handler->override_option('render_pager', TRUE);
  150. $handler->override_option('displays', array(
  151.   'block_1' => 'block_1',
  152.   'default' => 0,
  153. ));

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.