Skip to content

Instantly share code, notes, and snippets.

function MYTHEME_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'search_block_form') {
$form['actions']['button']['#prefix'] = '<button type="submit">';
$form['actions']['button']['#suffix'] = '</button>';
$form['actions']['button']['#markup'] = '<i class="icon-search"></i>';
}
}
@tmsss
tmsss / Using Drush to update to a specific version of core (not just the latest)
Last active November 4, 2015 18:14
Using Drush to update to a specific version of core (not just the latest)
drush pm-update projects drupal-6.28
from https://www.drupal.org/node/1861436>
@tmsss
tmsss / Drupal 6 jQuery behaviors
Created November 14, 2013 10:51
Drupal 6 jQuery behaviors (toggle example)
Drupal.behaviors.toggle = function(context) {
/*Add your js code here*/
$('#day').hide();
$("#show-example").click(function () {
if ($('#day').is(":visible")) {
$(this).html($(this).html().replace(/Hide/, 'Show'));
} else {
$(this).html($(this).html().replace(/Show/, 'Hide'));
}
@tmsss
tmsss / ctools modal handlers
Created November 12, 2013 21:54
Binding ctools modal handlers dynamically without page reload from http://www.nextide.ca/node/672
$('area.ctools-use-modal, a.ctools-use-modal').each( function() {
var $this = $(this);
$this.unbind(); // Note the unbind: Otherwise there are multiple bind events which causes issues
$this.click(Drupal.CTools.Modal.clickAjaxLink);
// Create a drupal ajax object
var element_settings = {};
if ($this.attr('href')) {
element_settings.url = $this.attr('href');
element_settings.event = 'click';
element_settings.progress = {
function THEMENAME_js_alter(&$javascript) {
$javascript['misc/jquery.js']['data'] = drupal_get_path('theme', 'THEMENAME') .
'/javascripts/jquery-1.7.2.min.js';
$javascript['misc/jquery.js']['version'] = '1.7.2';
}