This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drupal_add_js(array('VAR_JS' => $VAR_PHP), 'setting'); | |
// Alternative | |
drupal_add_js(array('CUSTOM_MODULE' => array('KEY' => 'value')), 'setting'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_form_alter(&$form, &$form_state, $form_id) { | |
if ($form_id == 'WEBFORM_ID') { | |
$form['submitted']['WEBFORM_FIELD_NAME']['#empty_option'] = 'TEXT'; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="/ajax/popup/node/[NID]/nojs" class="use-ajax">SOME_TEXT_HERE</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php print render(field_view_field('node', $node, 'field_CUSTOM', array( | |
'label' => 'hidden' | |
))); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom() { | |
drupal_add_js(drupal_get_path('module', 'CURRENT_MODULE') . '/CURRENT_MODULE_proto.js'); | |
$path = 'YOUR_PATH/' . $nid; | |
if ($alias = drupal_lookup_path('alias', $path)) { | |
$url = $alias; | |
} else { | |
$url = $path; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = window.location.href; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$commands[] = array('command' => 'MODULE_behaviors'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (strpos($SEARCH_HERE, 'SEARCH_SUBSTRING') !== false) { | |
// Do stuff.. | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drush pm-update MODULE_NAME-7.x-1.x-dev |