I want to embed a view in the tpl.php, so I am using the views_get_view('VIEWNAME') function.Here is what I am doing the tpl.php.
<?php
$view = views_get_view('MapView');
print $view->preview('default');
?>
"MapView" is the view's name, I am not sure the argument in the views_get_view is the machine name or human readable name, in fact in my example is using the human readable name, because I can't find the machine name in the drupal view configuration
anyway, I get a error saying "Fatal error: Call to a member function preview() on a non-object", seems like I didn't fetch the view in the correct ?
any idea ?
/admin/structure/views/view/%machine_name%/edit
) or with exporting a View ($view->name
will contain a machine_name.