With Drupal 8 just around the corner, every Drupal developer is in a nirvana of excitement and eagerness. Drupal keeps getting better and better every day and Drupal 8 will make website development and management a five-finger exercise, because this latest version of Drupal has included some amazing and potent Symfony components to serve the big businesses better.
We can use the l() to add links in our Drupal pages. However, while using the output of drupal_get_destination() in the l() as link, it may end up in the wrong functionality. If the drupal_get_destination() returns a url with parameters involved, then using that directly in the l() will cause the link to redirect to wrong page.
This article explains how to replace tokens to webform, views, blocks and Drupal forms from the node body. The preg_replace function for replacing the tokens. The preg_replace function works in the same way as preg_match. preg_replace is used to search a regular expression and replace it.
In one of my Drupal projects, I had a requirement to submit data from a webform to an external application. hook_webform_submission_insert() helps to meet my requirement. In your custom module, call the hook function hook_webform_submission_insert().
While working on a Drupal 6 project, I came across the requirement to send some mails. Interestingly, I couldn't find any good articles or procedures on the same. So, here, I am going to explain how to send mails in Drupal 6 with attachments. If you need any business support, get in touch immediately.
The drupal_write_record function is used to insert or update a record in the database based on the schema of the table. It helps in executing less database query. Let's take a look at the function given below.
JQuery and AJAX are very useful for loading data into the page without refreshing the web page. AJAX tabs can load content from remote files or URLs. In this example, the content of each Tab will be loaded dynamically with Ajax.
Entity in Drupal 7 makes web development much easier, like building structures using LEGO. We can build Entity types, that can be made Bundles. Here we can add fields and then create Entities. This article explains how to add fields.
I have faced several issues with MySQL installation while setting it up in my system. Hope this article will help you fix the mysql related issues. Here, I document the various steps I have taken to update MySQL installation.
While working on a Drupal website recently, I wanted to add a pop-up in some of the selected pages in a website with a delay of 15 seconds after page load. For all users, pop-up should be displayed only once in a day.
This article focuses on how to add new members to Drupal commerce store. Usually, when a new user created with admin role tries to access the store, the action will be restricted with an "Access denied" message. For a user to access the commerce store, he should be a member of the store. Let's find out how to resolve this issue.
Drupal commerce is a popular e-commerce module for Drupal. It is used to build ecommerce websites and applications and leverages the outstanding features of Drupal 7 for greater flexibility. Here, we will find out how to create a payment gateway module for Drupal commerce. There are mainly two types of payment gateway integration in Drupal Commerce:
Organic Groups module is a powerful and useful module in Drupal. This module is used to create groups, add members to it, and to share content and comments. OG also has advanced access management through permissions and roles.
If you are a Drupal developer and not a stranger to themes and its behaviors, let us see how to create a subtheme in Drupal. A sub theme is quite similar to a theme. When we create a sub theme, it has an independent folder structure as any theme. The only difference is that it inherits everything from parent theme. There are no limits in creating subtheme for a subtheme and so on.
As part of Drupal development project, we always use drush commands. Drush or Drupal shell refers to a command-line shell and scripting interface for Drupal. Drush enables developers to effectively manage and maintain their Drupal websites from the server command line. A few frequently used commands are listed below.
While working with entity, I always had a doubt as to why we use Entity and Entity Field query except Db_select() in Drupal. It is a great and fast way to organize and extract our data in Drupal sites. Here are a few more points to support these concepts :