Return to Snippet

Revision: 7063
at July 3, 2008 08:53 by shrop


Initial Code
$view = new stdClass();
  $view->name = 'Categories';
  $view->description = 'List of categories with number of articles posted in each category.';
  $view->access = array (
  0 => '1',
  1 => '2',
);
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = 'Browse Articles';
  $view->page_header = 'Browse articles by category.';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'teaser';
  $view->url = 'articles';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '100';
  $view->block = TRUE;
  $view->block_title = 'Categories';
  $view->block_header = '';
  $view->block_header_format = '1';
  $view->block_footer = '';
  $view->block_footer_format = '1';
  $view->block_empty = '';
  $view->block_empty_format = '1';
  $view->block_type = 'list';
  $view->nodes_per_block = '25';
  $view->block_more = TRUE;
  $view->block_use_page_header = FALSE;
  $view->block_use_page_footer = FALSE;
  $view->block_use_page_empty = FALSE;
  $view->sort = array (
  );
  $view->argument = array (
    array (
      'type' => 'taxletter',
      'argdefault' => '6',
      'title' => '%1',
      'options' => '',
      'wildcard' => '',
      'wildcard_substitution' => '',
    ),
  );
  $view->field = array (
    array (
      'tablename' => 'node',
      'field' => 'title',
      'label' => '',
      'handler' => 'views_handler_field_nodelink',
      'sortable' => '1',
      'options' => 'link',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(node);
  $views[$view->name] = $view;

Initial URL

                                

Initial Description
Creates a category list showing the number of posts in each category similar to some blogging platforms. The view exposes a block and page.

Initial Title
Drupal view to create a list of category terms

Initial Tags
drupal

Initial Language
PHP