Drupal
My standard Drupal server settings etc
Apache
- Drupal will work on Apache 1.3 or Apache 2.x hosted on UNIX/Linux, OS X, or Windows.
- Apache 'mod_rewrite' extension to allow for clean URLs.
- GD library 2.0 or higher
- 'mod_mime' for mail
MySQL
- MySQL 4.1 or higher
- Db user has to be allowed to: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, IN
Add same class on select form item as selected option
This is a jQuery script for Drupal forms changing the select form class to the same as the selected option item. I use the change event on select item because Chrome doesn't allow click event on option tags.
<?php
$script = '$(document).ready(function() {
$("select.bj-status-selector").change(function(){
var optClass = $(this).children(":selected").attr("class");
$(".bj-status-selector").removeClass().addClass("form-select bj-status-selector " + optClass);
});
});
';
drupal_add_js($script, 'inline', 'footer');
?>
Handy SQL print in table for drupal
Wim Leers codesnippet for Drupal AHAH
// Build our new form element.
$form_element = _mymodule_add_something_to_form();
// Build the new form.
$form_state = array('submitted' => FALSE);
$form_build_id = $_POST['form_build_id'];
// Add the new element to the stored form. Without adding the element
// to the form, Drupal is not aware of this new elements existence and
// will not process it.
Modification of Robots text file
Just some notes on what to modify in robots.txt file on an Drupal installation when using some modules like print, and AddThis. Disallow print, printmail, and bookmark.php. I always using clean URL:s, so I never change values in the last section.