Get a free quote now

Drupal 7

[Drupal] [Solved] How to fix the issue with product purchase through ubercart set user-id to (0) in the invoice by

We had faced an issue with invoice sent by, for anonymous purchase a product in ubercart in one of our Drupal 7 site. After the purchase is completed, the user receives an invoice from But if the user is anonymous, the invoice's customer id is set as zero. We had sorted out the issue and fixed it. Read on to know how to solve this problem

[Drupal] How to add a node to a queue programatically in Drupal?

February 26, 2015 - 11:12

Drupal 7 has a contributed module "Nodequeue" which allows users to collect nodes in an arbitrarily ordered list. It provides a simple drag-and-drop interface to manually order any queue. If you want to create a node to the nodequeue programmatically then you need to read this article. For creating you need to have two things: node id $nid and the queue name queue_name. Here how it can done, we firstly load the nodequeue by name and then add the node to the queue using function nodequeue_subqueue_add. Below code snippets adds a node to the queue.

[Drupal] How to create custom field values in taxonomy terms

February 25, 2015 - 12:45

Drupal 7 provides a flexible supports to create a Taxonomy. There is powerful core module called Taxonomy which allows us to create, manage and apply vocabularies. In Drupal, the terms are gathered within "vocabularies". Taxonomy has a ability to add taxonomy fields to vocabularies and terms. When we come across inserting the taxonomy terms programmatically, we will need to add fields values to that taxonomy term. So In this section we are going to create a custom field values to the taxonomy terms. Below is the code snippet, that is the array structure to create field values.

[Drupal] How to change the group manager(Organic groups) in Drupal?

February 25, 2015 - 12:14

To change the group manager of a group usually we search into option as "change group manager" but we dont find it anywhere. Because there is no option within Organic Groups holding such a decription. So we need to think futher and deeper into the concepts of organic groups. This articles tells you simple method to change the group manager of the group.

[Drupal] How to embed an MP3 player on your Drupal website?

February 23, 2015 - 10:44

The article explain how to make mp3 files directly streaming on your website without users having to download the file. To do so I am using contributed module from Drupal that is Soundmanager2 module. It provides the Drupal interaction with the soundmanager2 libraries containing three default player style. Here I am just creating a content type for uploading the mp3 files. By creating a node to this content type we can upload the files and displaying mp3 player will be done by soundmanager2 libraries. For integrating MP3 file in your Drupal 7 , you need download modules and the libraries.

[Drupal] How to collect data about the site during Drupal 6 to Drupal 7 Migration Process?

February 18, 2015 - 16:43

This article describes a checklist on some of the important data to be collected before migration and how to collect the data. This may seem like a trivial task but just like it is important to have a manual for an electronic device before you take it apart and put it back, it is important to have a technical manual of the site. If it is a complex site, with a lot of data, then this is mandatory.

[Drupal] How to replace a token within the content area of a node in Drupal?

February 16, 2015 - 18:51

One of our Drupal clients was using banner ads for their affiliates to bring in more members. Unfortunately these banner ads were placed inside the content with a page (A Drupal node) and the embed code for the banner ads generated using PHP code by enabling the PHP filter. If you have spent time in the Drupal world you would be knowing that enabling the PHP filter within the content area is a big security vulnerability. So the alternative was to use tokens. Read on to know how to replace a token within the content area of a node in Drupal.

[Drupal] How to create regions for a Drupal websites?

February 12, 2015 - 09:46

When we try to theme a Drupal website certain case we need to create particular region in the Drupal website. Adding region for a Drupal website is not a hard task, even a developer first creating a Drupal website can create a region. In order to add regions inside a Drupal website we only need to add a few lines extra for that. Below there are three version of drupal for the drupal 6 and 7 version creating the region is same but for the Drupal 5 version it is slightly different.

[Drupal] How to create a field formatter programmatically in Drupal sites

February 11, 2015 - 18:53

In Drupal, if you have a content type and you want to change the output of any field to something else you can use field formatter with field API. This enables a display settings for any fields in a content type and where you can manage the output as you wish. This article shares how to create a field formatter for your Drupal content types. There are some contributed modules for custom field formatters. But if you really want to create or learn about creating a field formatter programmatically, just go through this article

[Drupal] How to remove undesired local task tabs from pages programmatically

February 10, 2015 - 18:48

In Drupal, some modules add tabs to pages and these tabs(Primary tabs) are shown in the top of each page for authenticated users. Some of these tabs are not needed for some roles. There are cases where we want to hide such tabs, like - Bookmarks, File browser, orders etc., from primary tabs for roles other than administrator. We can remove these undesired tabs from primary tabs programmatically.

[Drupal] How to create a colorize theme by using Drupal 7 color module

February 10, 2015 - 18:45

This is an article about how you can create a custom color switching theme with the help of Drupal 7 color module. Color module is a Drupal core module comes with Drupal and you can use this module to colorize your theme. Garland is a Drupal theme which uses color module to colorize its various content. If you want to know more about how to create a colorized theme by using Drupal 7 color module read on.

[Drupal] How can we add translation to Drupal 7 site using translation module?

February 10, 2015 - 18:42

Consider you are creating a drupal website with multiple languages. We don't have to create two different sites for that. This can be achieved in the same site by using a module. In drupal for adding translations to the site we can use the Entity Translation Module. If we want to translate the title and other such fields to some other language then we can use the Title module. The different steps that has to be followed to add translation to Drupal 7 site using translation module are listed below.

[Drupal] How to add an SQL query to the global footer in Views without directly placing the PHP code in view?

February 09, 2015 - 18:26

Drupal 7 Views provides an option to add php to the Views footer in a View page. The option is called Global PHP. It allows you to add PHP code to views, to modify its output without adding code in a separate php file. However this option shoud be used with caution as a php error here can bring down the whole site and it would be difficult to detect. There is an alternative though. Read on to know how to add an SQL query to the global footer in Views without directly placing the PHP code in a view.

[Drupal] How to add relationship between custom and Users tables in Drupal views

February 07, 2015 - 10:52

Sometimes working on Drupal Views is very intimidating as this a very complex module
serving a variety of needs. No wonder it is one of top Drupal modules. Once I had a particularly
difficult time trying to figure out how to get a relationship right in Views by trying to get the user
name from the users table using a userid from a field in my custom table. However I managed to
figure out the soution by reading the query generated by Views. Read on to know how to add a relationship
between a custom table and Users table in Views below