Drupal behaviors (Drupal.behaviors)

Drupal behaviors (Drupal.behaviors) Drupal behaviors (Drupal.behaviors) are still part of javascript in core. These behaviors will be executed on every request, including AJAX requests. Don't forget to add a dependency to core/drupal in order to use Behaviors. Below is an example of a Drupal Javascript Behavior. (function ($) { 'use strict'; Drupal.behaviors.awesome = { attach:... Continue Reading →


Print ODD EVEN in best possible way.

Below is a program for finding wether a number is odd or even. I have described three different approaches and the approach will indicate the level of programmer Programmer If(x%2==0){ Print(“even”) } Else if(x%2!=0){ Print(“odd”) } 2. Good programer If(x%2==0){ Print(“even”) } Else{ Print(“odd”) } 3. Great programmer Array={“even”,"odd”} Print(Array[x%2])

The difference between asynchronous and non-blocking

The concepts of asynchronous and non-blocking have been around from a very long time, but the term asynchronous really started becoming really popular when AJAX began being used in mainstream web development. Similarly non-blocking started to become popular when Java introduced the non blocking API's for I/O, but it really took steam when node.js bought... Continue Reading →

Most used Drush commands in drupal 7

If you are into Drupal development and a vivid user of GNU/ Linux (or *nix) for a while, then Drush is a must learn tool for you. As a part of Drupal development project, we extensively use drush. A few commands that help us develop sites at the phase of clients expectation are briefed below,... Continue Reading →

How to add attach custom data fields to Drupal entities.

field.module template_preprocess_field(&$variables, $hook) Theme preprocess function for theme_field() and field.tpl.php. The function template_preprocess_field can be used to manipulate just the markup of the field in the $variables array before it’s output to your theme. There are a number of reasons why you would want to use this function as apposed to overriding field.tpl.php or node.tpl.php... Continue Reading →

How does caching work in Drupal?

Drupal caching system allows customized settings to speed up website using different configuration with page caching, block caching and lifetime for cached pages. Page caching: If enables, page caching will only be used for anonymous users. If you enable page caching, the entire HTML of each page will be stored in the database. This significantly... Continue Reading →

Most popular drupal 7 modules

Views – This module is essential in every website I build. It makes displaying lists of content very easy. If you want an image slideshow, a list of blog posts, a list of products, etc., views is the best place to start. Panels – Panels gives you the ability to create custom pages easily. These... Continue Reading →

What is the difference between Core and Contrib in drupal 7

The standard release of Drupal, known as Drupal core, contains basic features common to content management systems. These include user account registration and maintenance, menu management, RSS-feeds, page layout customization, and system administration. The Drupal core installation can be used as a brochureware website, a single- or multi-user blog, an Internet forum, or a community... Continue Reading →


Up ↑