I have a somewhat noobish question. Here's the thing: I want a showcase on my frontpage, which is a custom tpl-file. So I tried to print the view with this:

<?php
$view = views_get_view('showcase');
print $view->execute_display('default', $args);
?>

It works as expected, the view is printed, but it looks like this (testpage). Apparently, I have to load the neccesary js-files through drupal_add_js. But how to do this? Simply taking the lines from views-showcase-view.tpl.php and putting them in template.php doesn't work. Or am I on the wrong track altogether?

As you must have guessed, I'm not a coder. I'd be grateful if someone could point me in the right direction.

Comments

Aart’s picture

Status: Active » Fixed

Fixed the javascript issue. In case anyone needs it in the future, I used this in template.php:

function basic_preprocess_page(&$vars) {
  $vars['showcase'] = views_embed_view('showcase');
  $vars['scripts'] = drupal_get_js();
}

Then in page-xxx.tpl.php simply:

<?php print $showcase; ?>

raiyne’s picture

Might be a dumb question; but does this eliminate the images all showing/stacking before loading?

Aart’s picture

Sorry, it doesn't. I'd also like to fix that, though.

raiyne’s picture

I'll slip you a twenty if you do :) Man I want this module to work (compliantly) so bad!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.