Knowledge Base

Drupal jQuery behaviors

Submitted by Jitesh Doshi on Sun, 05/12/2013 - 14:49

In this article, I try to explain "Drupal Behaviors". Drupal provides a very clean way of attaching JavaScript code to HTML components. It includes jQuery library with it. So you have to do nothing to add jQuery to your app. But on top of it, you also don't have to attach onload event handlers in JavaScript. Instead you simply write "Drupal JS behaviors" which are JavaScript functions that get invoked when attached (document loaded) or detached (document unloaded).

Let's take a look at an example:

Automating Drupal user login and maintaining session in curl

Submitted by Jitesh Doshi on Thu, 04/04/2013 - 22:04

Using the services module in Drupal to expose CRUD operations on nodes is a great way to expose RESTful service from Drupal. All you have to do is to enable rest_server sub-module and create a REST server in it. Now you start fetching your nodes in XML, JSON or many other formats. Now for testing, the 'curl' command line browser was used to make HTTP requests in an automated fashion. Making read-only requests to fetch nodes as JSON was easy.

Drupal Zen theme and SASS

Submitted by Jitesh Doshi on Fri, 02/15/2013 - 21:26

Zen is one of the best themes (in terms of solid, clean foundation) out there. And 7.x-5.x release is even better than previous ones. It comes with a drush command to create Zen subthemes in seconds. It also has very clearly laid out and documented CSS stylesheets in the css folder that allow easy modification of styles.

Reduced Drupal bootstrap for better performance

Submitted by Jitesh Doshi on Fri, 11/02/2012 - 18:39

Did you know you can use Drupal in your custom PHP scripts, outside of modules? Possibly. But did you know that you can make your scripts much faster by reducing Drupal's bootstrap levein your scripts? Read on to see how.

The following script reads the first 20 nids (node-ids) from your Drupal database.

Adding roles to users on account creation

Submitted by Priya Ganesan on Sat, 03/03/2012 - 15:31

On one of the Drupal 6 projects we had the need to assign a specific role to all users who create their own account (by visiting 'user/register'). Let's say the role is 'abc' and the role id (rid) is 3. So every new user should have the 'abc' role automatically. After much reseach I found the winning formula :-)

SpinSpire releases OpenID Helper module

Submitted by Jitesh Doshi on Wed, 02/29/2012 - 22:48

We are pleased to announce the beta release of our OpenID Helper Drupal module (see http://drupal.org/sandbox/jitesh_doshi/1460772). OpenID module, included in Drupal core, is very useful, but not very user-friendly. It expects users to know what their OpenID provider URL is. The OpenID Helper module makes it a little more user-friendly by giving the user a dropdown list well-known OpenID providers to choose from. 

SpinSpire releases Webform Single Use Options module

Submitted by Jitesh Doshi on Wed, 02/29/2012 - 13:14

<p>SpinSpire is pleased to announce the beta release of our Webform Single Use Options Drupal module (see <a href="http://drupal.org/sandbox/jitesh_doshi/1439044">here to view</a>). Webform module is a very useful and versatile module that we have used in many situations. But sometimes you need a webform select list to start removing options once they have been used in a submission.

Subscribe to Knowledge Base