certainlyakey
4/13/2016 - 6:51 AM

Programatically add a block to a Drupal view

Programatically add a block to a Drupal view

<?php 
    $nid = $variables['view']->result[$id]->nid;

    $array = array($nid);
    $view = views_get_view('travel_destination_header');
    $view->set_display("block");
    $view->set_arguments($array);
    $view->pre_execute();
    $view->execute();
    $content = $view->render(); 
    print $content;