Skip to content

Instantly share code, notes, and snippets.

@BramEsposito
Last active December 10, 2015 08:08
Show Gist options
  • Save BramEsposito/4405453 to your computer and use it in GitHub Desktop.
Save BramEsposito/4405453 to your computer and use it in GitHub Desktop.
Drupal: Embed a view with custom parameters. (works in node body with PHP text format == dirty hack)
<?php
$display_id = "departement";
$args = array("view argument");
$view = views_get_view('view machine name');
$view->items_per_page = 0; // set number of items per page. 0 is all.
$content = $view->execute_display($display_id, $args);
print($content['content']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment