
Drupal core provides support for migrating data from Drupal 6 or 7. The templates provided in core migrate your data in a very specific way. They attempt to copy things verbatim whenever possible. However, you may wish to alter this for your migrations. In this tutorial we are going to explore the various ways that you can alter the existing Drupal-to-Drupal migrations to meet your needs.
Filter plugins provide the logic for determining what items to include in a view. They are the equivalent of a WHERE
clause in an SQL statement. Filters can be exposed to the end user, allowing the viewer to enter a value, or select from a list of options, that are used to filter a list. For example, the options at the top of the Content list at /admin/content allow you to limit the list by content type.
Drupal's Views module provides filter plugins that can handle filtering for all core defined field types, as well as generic data types like numbers and strings. In situations where these filters don't meet your functional requirements, or you need a filter for a custom field, you may want to define a custom Views filter plugin. A common real-world scenario is defining a new filter plugin that extends an existing one and adds new possible values or options. For example, providing a relative date filter that allows a user to choose options like Last week or Last month.
In this tutorial we'll:
- Learn how to create a Views filter plugin.
- Associate our new custom filter with data exposed to Views, so it can be used.
- Learn how to use it in a view as an exposed filter.
By the end of this tutorial you should know how to create a custom filter plugin and use it in Views.
Introduction to Drush
Blog postExperienced developers, and new site builders alike can remember a time when installing a module meant visiting it's project page on drupal.org, downloading and unpacking it and dropping it in the correct directory. That process can be quite tedious every time there's an update if your site has dozens of modules. Thank goodness for drush. While drush's utility certainly isn't limited to helping download modules for your site in an efficient manner, it's an absolutely invaluable tool for anyone working with Drupal sites on a regular basis. We're happy to present a new series, Introduction to Drush, with the first video, What is Drush?, released today.
Often we don't want to run just one container at a time, but a set of containers that act together to provide a unit of functionality. Yet, docker run
only starts one container at a time, with one command in each container at a time.
Docker Compose lets us overcome this limitation by allowing us to define a single file that describes multiple containers, their relationship to each other, and utilities to manage that set of containers as a single unit.
In this tutorial, we'll:
- Introduce Docker Compose
- Run multiple containers at once using Docker Compose
- Identify the purpose of docker-compose.yml
- Learn what resources a set of containers share
Do you know some PHP and want to learn how to create a custom page at a custom URL in Drupal? You're in the right place.
Every web framework has the same job: provide a way for developers to map user-accessible URLs with code that builds the page. Routes, controllers, and responses are what module developers use to create pages at custom URLs in a Drupal site.
In this tutorial, we'll:
- Define what routes, controllers, and responses are.
- Explain the routing workflow that Drupal uses to match a URL to a route.
- Define routing system-related terms like parameter and upcasting.
By the end of this tutorial, you should be able to explain how a developer uses routes, controllers, and responses to create custom pages in a module.
Code generators are great productivity boosters that allow generating scaffolds for common development tasks in Drupal. One of the most common use cases for generators is scaffolding the code required for a custom entity type. Custom entities require many files and complicated annotations in order to function properly. There is a lot of boilerplate code that is more-or-less the same for every entity type. Creating all the files is repetitive, time-consuming, and prone to human error. Generators can help automate this task and make creating your own custom entity types quicker.
In this tutorial we'll:
- Learn how to generate the code for a custom entity with Drush
- Learn about the options that generators provide for custom entities
By the end of this tutorial you should know how to generate custom entities with Drush.
Sort plugins are responsible for determining how the data in a list created with Views is sorted. Sort plugins are applied to fields. For example, a field might contain numbers and the sort plugin can handle putting the values into ascending or descending order. Typically, sort plugins work by adding to the ORDER BY
clause of an SQL query.
The Views module provides sort plugins for all core field types. This includes handling for most primitive data types like strings and numbers. A typical use case for creating a custom sort plugin is extending an existing sort plugin with new conditions or custom sorting logic. For example, you might need to create an alphabetical title sort that excludes articles like a, an, and the. Or a sort based on combining the values in multiple fields.
In this tutorial we'll:
- Learn how to create a custom Views sort plugin
- Associate our custom sort plugin with a field exposed to Views
- Use the sort plugin in a view to sort a list of Article nodes
By the end of this tutorial you should know how to create a custom sort plugin for the title field.
php[tek] Conference Is Next Week
Blog postWith the addition of Symfony to Drupal core, many Drupal developers are beginning to explore beyond the confines of our own amazing CMS. But where do you start? Conferences can be a great opportunity to step outside of your day-to-day time crunch and learn about new technologies. php[tek] is one of those great opportunities for module developers in the mid-west United States. This conference, now in its 13th year, has over 50 sessions spread over four days, May 14-17, in Chicago, Illinois.
In this series, Object-Oriented PHP Part 3, we'll teach you all about inheritance in PHP, including how that works in classes, abstractions, and interfaces. These concepts are keys to understanding the code you will see in Drupal 8 modules.
Services
TopicServices are objects that encapsulate the code for performing specific tasks in a reusable and decoupled way.
Drupal has a few handy settings you can tweak to make developing themes a little more intuitive and a lot more awesome. In this tutorial, we'll practice manually setting up our environment for theme development by:
- Disabling some caches
- Turning off CSS and JS aggregation
- Turning on the Twig debug service
By the end of this tutorial, you'll have practiced setting up your environment for theme development.
The Configuration Manager module gives you as an administrator the ability to import and export configuration items on different instances of a Drupal site using a graphical user interface. In this tutorial, we'll take a tour of the Configuration Manager and the administrative interface it provides.
By the end of this lesson you will be able to:
- Access administrative pages for Import, Export, and Synchronize
- Find and configure permissions for Configuration Manager
- Identify the 3 primary actions of configuration management and how to perform them using the UI
Setting up Drupal to Learn and Practice
Blog postOsio Labs intern Chinelo Obigwe shares her insights on getting Drupal installed for the first time on her Windows machine in this new blog post on Drupalize.Me. Read on to learn about several local web development environment tools she recommends to anyone starting out with learning Drupal and who wants to get Drupal up-and-running on their own machine.
This tutorial will clarify some basic ideas about software testing. We'll give some strategies for testing and illustrate types of tests and when and why you'd use them. This document is written with Drupal in mind, but the concepts apply for other development environments you'll encounter as well. The tools will be different, but the ideas apply universally. By the end of this tutorial, you should understand what testing is for and how different types of tests support different purposes and outcomes.
New Series: Coding for Views
Blog postViews is without a doubt the most popular module on drupal.org, and one of the reasons for it’s popularity is the plethora of modules that enhance the out of the box views experience. These modules add new display options like a calendar or Javascript caoursel, new formatters for existing fields, and even new backends so you can query things other than MySQL. Like Drupal itself views is written to be extended and it’s not uncommon to need to do just that in order to meet your site specific requirements.
Release Day: Views for Developers
Blog post10 years ago we released the first tutorials in our Drupal 7 Coding for Views Series. Today we're super excited to release the first 8 tutorials in our new Views for Developers series, a Drupal 8+ update to Coding for Views.
Overview of text formats, filters, editors, and cross-site scripting.
Overview of the User 1 account, also known as the root account or administrative account.
While the administrative UI for Configuration synchronization certainly provides a simple and effective means to export and import configuration, it is by no means the preferred method. The Drush command line utility provides the same functionality without the need for a web interface or the need to log in.