/ Published in: PHP
This will create a general site blog teaser list at /blog. It requires a cck type named blog. This view also generates an RSS feed for the blog. This is compatible with Views1 for Drupal 5.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$view = new stdClass(); $view->name = 'blog'; $view->description = 'Blog'; ); $view->view_args_php = ''; $view->page = TRUE; $view->page_title = 'Blog'; $view->page_header = ''; $view->page_header_format = '1'; $view->page_footer = ''; $view->page_footer_format = '1'; $view->page_empty = 'No blog posts at this time. Please check back later.'; $view->page_empty_format = '1'; $view->page_type = 'teaser'; $view->url = 'blog'; $view->use_pager = TRUE; $view->nodes_per_page = '10'; $view->block = TRUE; $view->block_title = 'Latest Blog Posts'; $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 = '6'; $view->block_more = TRUE; $view->block_use_page_header = FALSE; $view->block_use_page_footer = FALSE; $view->block_use_page_empty = TRUE; array ( 'tablename' => 'node', 'field' => 'created', 'sortorder' => 'DESC', 'options' => 'normal', ), ); array ( 'type' => 'rss_feed', 'argdefault' => '2', 'title' => '', 'options' => '', 'wildcard' => '', 'wildcard_substitution' => '', ), ); array ( 'tablename' => 'node', 'field' => 'title', 'label' => '', 'handler' => 'views_handler_field_nodelink', 'options' => 'link', ), ); array ( 'tablename' => 'node', 'field' => 'status', 'operator' => '=', 'options' => '', 'value' => '1', ), array ( 'tablename' => 'node', 'field' => 'type', 'operator' => 'OR', 'options' => '', 0 => 'blog', ), ), ); ); $views[$view->name] = $view;