Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save certainlyakey/acbdfe65af1eb40e7485b13da78d4b21 to your computer and use it in GitHub Desktop.

Select an option

Save certainlyakey/acbdfe65af1eb40e7485b13da78d4b21 to your computer and use it in GitHub Desktop.
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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment