Drupal

How to Print Variables using Devel and Kint in Drupal

As a Drupal developer, you will often want to inspect variables in your modules or themes to view the actual values. PHP has default functions such as var_dump() and print_r() that will print all the information but it’s not very intuitive nor printed in an easy to understand way. In most cases, it prints too much information and it can be time-consuming to find the variable you actually want by filtering through all the arrays and methods.

Using Devel and the Devel Kint Extras modules, you can print variables in a more user-friendly way.

This tutorial will walk through how to set up these modules so you can print variables in PHP and Twig using Kint.

Add Autocomplete Search Results to Text Fields in Drupal

Search is an important function in almost every site. There is a simple feature which we can implement to improve user experience, and that is ‘search autocomplete’.

Autocomplete means ‘predictive text’, and it is a feature in which the system predicts the rest of a word a user is typing.

It provides suggestions of words to users while typing, and speeds up the human-computer interaction. It can work well particularly in search because the list of suggested words will come directly from controlled keywords from the system itself.

It is also helpful in situations where long words or hard-to-spell terminologies are involved.

In this tutorial, we’ll learn how to install and configure the Search Autocomplete module in Drupal. The module provides an easy way to convert any text field into an autocomplete field.

How to Attach Files to Emails using Webform in Drupal

By default, Drupal does not support allowing a user to upload a file in a webform which can then be sent as an email attachment. Drupal can accomplish this using the contributed modules Webform and Swift Mailer.

The Webform module is a comprehensive module that allows you to create and configure webforms. In a nutshell, it will enable you to create a webform with many variations of form fields. After submission, the results can be sent via customizable emails.

This tutorial will focus on creating a file upload field whereby a user can upload a local file into a webform.

Send Webform Submissions to Mailchimp in Drupal

The Webform Mailchimp module allows you to send Webform submissions to your Mailchimp list whilst also allowing you to map the Drupal webform fields to MailChimp form fields.

When a user submits the Drupal webform, the submission details are sent directly to MailChimp. When you log into MailChimp you can view the submission details within the MailChimp interface and the fields are mapped accordingly.

This can be easily accomplished using the Webform Mailchimp module (along with its dependencies). The dependencies are:

You need a MailChimp account (with at least one list).

Getting Started with Metatag Module in Drupal

The Metatag module allows you to configure structured metadata such as meta descriptions and meta keywords for your Drupal website. You can do this at the global level, on a per content type basis, per node basis and even on a per view page basis.

In this tutorial we will show you how to:

  • Install the Meta Tag module
  • Configure meta tags for a content type
  • Override meta tags on a per node basis
  • Override meta tags for View pages
  • Have more granular permissions for meta tags fields
  • Specify meta tags for different favicons

Getting Started with Mailchimp in Drupal

Mailchimp is a web based email marketing service used to send mass emails to a list of subscribers.

Drupal, out of the box, already allows you to send emails. However, there are distinct advantages to using a service like Mailchimp to send emails and maintain your mailing lists.

In this tutorial, you’ll learn how to integrate Drupal and Mailchimp.

The Mailchimp module integrates Mailchimp and Drupal by allowing Drupal to connect via Mailchimp’s API. This module also comes with a few submodules. Each submodule provides additional functionality that leverages Mailchimp’s features.

Bulk Update Content using Views Bulk Operations in Drupal

View Bulk Operations, commonly referred to as VBO, is a module that allows specifically defined actions that can be simultaneously executed on rows of Views data.

This tutorial will show how to install this module and set up a simple View with a defined action and VBO field. We will then demonstrate how to use VBO to perform this action on selected View rows. We will also show how you can define permissions for roles to use our defined action.

Create Internal Links using the Linkit module in Drupal

Linkit gives you an easy interface with an ‘autocomplete’ field to search for content on your site, and then link to it. In other words, it provides search functionality to find the content on your site and insert the corresponding internal link.

Using the same interface, you can also insert external links. So you can insert links, both internal and external, with the same interface.

It supports internal links to nodes, users, taxonomy terms, files and comments, etc. With this module, you do not need to copy or remember the target URL, or go back and forth to find out and verify the exact link. It provides a more user-friendly interface well integrated with the insert link function of the editor.

Create Infinite Scroll pages using Views Infinite Scroll in Drupal

Infinite scrolling is a technique used to show more content as the user scrolls down a page eliminating the need for the user to click to go to the next page. This is commonly implemented in popular social media apps.

This tutorial will demonstrate how to use the Views Infinite Scroll module to achieve this and also show options that can be used to customize the user interaction with the infinite scrolling behavior.

Scroll to Top