5

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

Alessandro Pezzato
  • 8,603
  • 5
  • 45
  • 63

2 Answers2

3

Have you tried?

print views_embed_view("super_gallery", "block", $gallery_arguments);
antyrat
  • 27,479
  • 9
  • 75
  • 76
Ken Jokol
  • 46
  • 2
0

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

junedkazi
  • 519
  • 7
  • 18
  • Installed, bu I don't understand how this module can help me. I'm already using views_embed_view, and it embeds the view, even without *embed_views* installed. But it doesn't use the template *views-view-grid--super-gallery--block.tpl.php* – Alessandro Pezzato Jan 21 '12 at 18:50
  • @AlessandroPezzato How did you solve the issue eventually or was it a Views bug that was fixed? Because currently I am not experiencing this problem. – W.M. Apr 13 '16 at 10:55