Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global $language;
- //create a new view
- $view = views_new_view();
- //define the view (this code was generated by the Export)
- $view->name = 'products';
- $view->description = '';
- $view->tag = '';
- $view->view_php = '';
- $view->base_table = 'node';
- $view->is_cacheable = FALSE;
- $view->api_version = 2;
- $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
- $handler = $view->new_display('default', 'Defaults', 'default');
- $handler->override_option('fields', array(
- 'title' => array(
- 'label' => 'Title',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'alt' => '',
- 'prefix' => '',
- 'suffix' => '',
- 'help' => '',
- 'trim' => 0,
- 'max_length' => '',
- 'word_boundary' => 1,
- 'ellipsis' => 1,
- 'html' => 0,
- ),
- 'link_to_node' => 1,
- 'exclude' => 0,
- 'id' => 'title',
- 'table' => 'node',
- 'field' => 'title',
- 'relationship' => 'none',
- ),
- ));
- $handler->override_option('filters', array(
- 'status' => array(
- 'operator' => '=',
- 'value' => '1',
- 'group' => '0',
- 'exposed' => FALSE,
- 'expose' => array(
- 'operator' => FALSE,
- 'label' => ''
- ),
- 'id' => 'status',
- 'table' => 'node',
- 'field' => 'status',
- 'relationship' => 'none'
- ),
- 'language' => array(
- 'operator' => '=',
- 'value' => array(
- $language->language => $language->language,
- 'und' => 'und'
- ),
- 'group' => '0',
- 'exposed' => false,
- 'expose' => array(
- 'operator' => false,
- 'label' => ''
- ),
- 'id' => 'language',
- 'table' => 'node',
- 'field' => 'language',
- 'relationship' => 'none'
- )
- ));
- $handler->override_option('access', array(
- 'type' => 'none',
- ));
- $handler->override_option('cache', array(
- 'type' => 'none',
- ));
- $handler->override_option('row_options', array(
- 'inline' => array(),
- 'separator' => '',
- ));
- // now output the view (or whatever you want to do with it)
- print $view->execute_display('default', array());
Advertisement
Add Comment
Please, Sign In to add comment