Skip to content

Instantly share code, notes, and snippets.

@iampuma
iampuma / drupal-ajax-change-url.php
Last active September 11, 2015 14:02 — forked from keeprock/custom.module.php
Loads views with ajax.- Generating links with special addresses- Creating menu item with ajax page callback- Writing ajax callback with Drupal Ajax functions- Loading view with contextual filters (from url)- Replace view with Drupal Ajax functions
function custom_menu() {
$items = array();
$items['ajax/custom_module/custom_action/%/%'] = array(
'title' => 'Title',
'delivery callback' => 'ajax_deliver', // important here!
'page callback' => 'custom_module__pagecallback',
'page arguments' => array(3,4), // index starts with zero
'type' => MENU_CALLBACK,