Search code examples
drupal-7drupal-viewsdrupal-theming

Drupal7 print embed block of view in another views tpl


I need to print block of view in another view tpl.

I use this: <?php print views_embed_view( 'blog_popular','block'); ?>

'blog_popular' is view Machine Name.

But not worked.


Solution

  • You could try this code:

    $blockObject = block_load('views', 'blog_popular');
    $block = _block_get_renderable_array(_block_render_blocks(array($blockObject)));
    $output = drupal_render($block);
    print($output);