Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
i want to embed a view that uses this plugin on my frontpage. Therefore i embedded the view in page.tpl.php like this
if($is_front){
print views_embed_view('frontpage_teaser','embed','');
}
But its not working. The items are all shown as regular list-items with no transitions :(
If i embed it in my node.tpl.php the same way, its working fine. So: i saw that its not loading the needed javascripts in the footer when embedded in page.tpl.php. Anyone knows how i can solve this? Does it makes a difference if i create a frontpage-template-file and embed it there?
Thanks in advance
Fab
Comments
Comment #1
Crell CreditAttribution: Crell commentedThat's because the preprocess functions for views_cycle queue up additional JS and CSS that's needed for views_cycle to work. If you're in the page template, though, the page's CSS and JS header elements have already been processed and created so the new ones from views_cycle won't get added.
You really shouldn't be calling a view like that in the first place. It's very likely to break in creative ways. If you want arbitrary positioning like that, embedding the view into a page created with the Panels module is going to be a more sustainable approach.
Comment #3
wavesailor CreditAttribution: wavesailor commentedAnother solution using jQuery is explained here:
http://drupal.org/node/823056#comment-4580448
Comment #4
burningdog CreditAttribution: burningdog commentedCool, nice fix @wavesailor :) You could also use drupal_add_js() to add that code in a module - I guess you could do it in the theme too.