When theming Drupal and wanting to output a view there are occasions where using a view display (e.g. a page, or a block - perhaps placed within a custom region ;-) ), or using Views Attach will not suffice.
Instead, you can embed a view using the following PHP snippet:
(NOTE: you'll need to have the core PHP input filter enabled if embedding in a node body)
<?php
$view = views_get_view('VIEWNAME');
print $view->preview('default');
?>or, if you need to use an argument with the view:
<?php
$args = array(ARGUMENTS);
$view = views_get_view('VIEWNAME');
print $view->preview('default', $args);
?>





Hi, I'm Laurence and this is my Drupal blog.
Don't Make Me Think!
Using Drupal
PHP Cookbook
Pro Drupal Development, Second Edition