Drupal 7 views_embed_view and templates

10.4k views Asked by At

In Drupal 7

  • created a block view (called *super_gallery*) of grid format
  • added a template specialization views-view-grid--super-gallery--block.tpl.php
  • cleared theme registry
  • cleared all caches

Using preview in view editor I can see output modified by the template. GOOD

Using <?php print views_embed_view("super_gallery", "default", $gallery_arguments); ?> inside another template to show *super_gallery* view, it shows output without changes. BAD

How can I use templates with views_embed_view?

EDIT 1 Tried also with:

$view = views_get_view("super_gallery");
print $view->preview("default", $gallery_arguments);

and

$view = views_get_view("super_gallery");
print $view->execute_display("default", $gallery_arguments);

Nothing changed

2

There are 2 answers

0
Ken Jokol On BEST ANSWER

Have you tried?

print views_embed_view("super_gallery", "block", $gallery_arguments);
2
junedkazi On

Have a look at this module

http://drupal.org/project/embed_views

OR Have a look at the following comment

http://drupal.org/node/1138866#comment-4845070