Thursday, February 2, 2012

How to display View (Block types)

//load the view by name
$viewName = views_get_view('promo_blocks_homepage');
//output the view
$output = $viewName->execute_display('block_1');
print $output['content'];

whereas View (Page types) renders as :

//load the view by name
$viewName = views_get_view('promo_blocks_homepage');
//output the view
echo $viewName->execute_display('page_1');