You're right about the rotator not working in the page.tpl.php files when embedded there. When the view is rendered for the page the JavaScript is added. In the case of the page.tpl.php files the $scripts variable is already populated with the scripts to be loaded into the page. So, this script is not added there. At the point you've gotten to the embedded view the $scripts variable has already been rendered as html.
Instead do something like this:
In your template.php file:
<?php
function THEMENAME_preprocess_page(&$vars) {
$vars['my_view'] = views_embed_view(...your parameters....);
$vars['scripts'] = drupal_get_js(); // This rebuilds the scripts variable.
}
?>In your page-front.tpl.php file put $my_view where you want the embedded view to be.
Hello, I tried to use views rotator in front page of modified adari theme (page-front.tpl.php). I create the view, set style in views-rotator and call in frontpage thougt this code:
$view = views_get_view('destaca');
print $view->execute_display('block', $args);
The view works, but the rotator doesn´t. Even the rotator's .js is not included automatically, and if I include it manualy doesn't work either
.