/ Published in: PHP
Creates a category list showing the number of posts in each category similar to some blogging platforms. The view exposes a block and page.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$view = new stdClass(); $view->name = 'Categories'; $view->description = 'List of categories with number of articles posted in each category.'; 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; ); array ( 'type' => 'taxletter', 'argdefault' => '6', 'title' => '%1', 'options' => '', 'wildcard' => '', 'wildcard_substitution' => '', ), ); array ( 'tablename' => 'node', 'field' => 'title', 'label' => '', 'handler' => 'views_handler_field_nodelink', 'sortable' => '1', 'options' => 'link', ), ); array ( 'tablename' => 'node', 'field' => 'status', 'operator' => '=', 'options' => '', 'value' => '1', ), ); ); $views[$view->name] = $view;