Return to Snippet

Revision: 12999
at November 24, 2009 08:30 by level09


Updated Code
<?php

  $view_args = array();
  $display_id = 'page_1';
  $view = views_get_view('view_name');

//avoid error if view is not created yet !
       if ($view && !empty($view)) {
        print $view->execute_display($display_id , $view_args);
  }
?>

Revision: 12998
at April 3, 2009 16:26 by level09


Initial Code
<?php

  $view_args = array();
  $display_id = 'page_1';
  $view = views_get_view('view_name');
       if (!empty($view)) {
        print $view->execute_display($display_id , $view_args);
  }
?>

Initial URL

                                

Initial Description

                                

Initial Title
Create views programmatically

Initial Tags
drupal

Initial Language
PHP