Andrew Berry, from Lullabot, has written a great article asking Should you Decouple? Like most architectural decisions there are trade-offs to consider with a decoupled approach. Let's take a look at some of the pros and cons of a decoupled approach. Is it the right choice for your project?
At this point, whether we've decided to use a third-party pre-rendering service or we've written our own isomorphic JavaScript application to serve as the front-end of our website, our hosting requirements have definitely gotten more complex. Let's take a look at the continuum of decoupled site architectures and start to come up with a list of things to keep in mind when considering their hosting requirements.
Today's Drupal developer needs more than just a text editor and FTP. Best practice Drupal development involves a suite of tools, processes, and more than one server environment.
This tutorial is directed toward an audience that is not familiar with best practices in Drupal Development and methods involving version control with Git, IDEs, local development environments, and deployment environments (i.e. stage, live). Here we're providing a high-level overview of these topics with links to dive deeper if you need more information.
In this tutorial, we'll cover:
- Introduce Version Control Systems such as Git
- Discuss how Git can be used to deploy to remote web servers
- Review programming-centric text editors and Integrated Development Environments
- Identify the need for a local development environment.
- Explain shared deployment environments including production and stage.
This tutorial teaches you everything you need to know about using the tutorials on Drupalize.Me.
Drush is the command line shell and Unix scripting interface for Drupal. The most common way to install Drush is to install it on a per-project basis using Composer. We'll walk through the steps to do that, as well as how to set up the Drush Launcher tool (to make it possible to execute Drush commands without having to specify a full path to the executable).
In this tutorial we'll:
- Install Drush
- Verify it worked
By the end of this tutorial you'll have Drush installed.
Every Drupal module needs a *.info.yml file; the basic structure of a form controller class and related routing is the same for every form; and much of the code required to create a custom content entity type is boilerplate annotations and extending base classes. Wouldn't it be nice if there was a way to automate some of that repetitive work? Drush can be used to speed up module development by generating scaffolding code for event subscribers, forms, services, module files, routing, and much more. These generators are provided by the Drupal Code Generator project. They're neatly bundled up in Drush under the drush generate
command.
Before Drush 9, there were no code generators in Drush, but the Drupal Console project provided them. That project and its code generators, have languished since the release of Drupal 9. While it can still be used, and is often referenced in tutorials about Drupal, we much prefer the code generated by Drush at this point.
In this tutorial we'll:
- Learn about the Drupal Code Generator project
- Learn how Drush integrates with this project
- Demonstrate the
drush generate
command and its options
By the end of this tutorial, you'll know how to use the drush generate
command to speed up development for your Drupal modules.
A multisite Drupal installation allows you to host multiple, separate websites while relying on the same set of code. Large organizations often rely on a multisite installation to cut down on the operational upkeep of multiple sites. Hosting a multisite in Docker poses several additional challenges. Fortunately, the process is not dissimilar from configuring a bare-metal server to run a multisite.
In this tutorial, we'll:
- Outline a multisite's additional requirements for Docker containers.
- Configure alternate, local domain names to resolve each site.
- Learn how to configure a multisite to use alternate domain names.
Installing Drupal using the instructions in this tutorial will give you a working Drupal site that can be used for learning, or real-world project development.
Before you can work on a Drupal site locally (on your computer), you'll need to set up a local development environment. This includes all the system requirements like PHP and a web server, that Drupal needs in order to run. Our favorite way to accomplish this is using DDEV.
In this tutorial we'll learn:
- How to install and configure DDEV for use with a Drupal project.
- How to use DDEV's integrated Composer to download Drupal and Drush.
- How to install Drupal inside DDEV so you can access the site and start doing development.
By the end of this tutorial, you should be able to set up a local development environment for learning Drupal or working on a new Drupal project.
Goes into depth about some of the JavaScript constructs and tools that Drupal provides when writing JavaScript for Drupal. Topics include using Drupal.behaviors and variable settings.
There where a couple of changes to the Drupal.behaviors system for D7. You can find out more information about the changes here: http://drupal.org/update/modules/6/7#drupal_behaviors
And more general information about using the new system here http://drupal.org/node/756722
Once you've converted from the old Drupal.behaviors.myModule = function(context)
to the new syntax
Drupal.behaviors.myModule = {
attach: function(context, settings),
detach: function(context, settings)
}
The rest is pretty much the same.
This lesson shows the steps and code to add on the Drupal side in order to load JavaScript scripts to you site. One thing to note is that the HTML5 placeholder attribute makes this plugin invalid markup.
NOTE:
There is a minor change between Drupal 6 and Drupal 7, where you should use function($)
to wrap your code. For Drupal 7 you can use:
(function($) {
$(document).ready(function() {
$('#search input.form-text').autofill({
value: Drupal.t('Search...'),
});
});
}(jQuery));
Goes over the Macro Maker demonstration module in order to show what functionality we will be building over the next couple of chapters.
Learn how to integrate jQuery scripts into Drupal, and how to leverage the JavaScript capabilities of the Drupal API in both 6.x & 7.x
Jeff Robbins and Nate Haug introduce the jQuery and Drupal integrations that we'll be building in this series, based on the foundations of theming, module development, and jQuery.
- How to add jQuery to a theme
- How to utilize Drupal's drag and drop behavior to reorder elements on a page within any form that has orderable items
- Drupal's direct integration with jQuery through the Forms API in Drupal 6 and Drupal 7
- Building a highly optimized AJAX request to Drupal that will return a JSON result
- The JavaScript state system in Drupal 7
Note: The examples in the video span across Drupal 6 and Drupal 7, and jQuery code that will work either in jQuery version 1.2.6 or 1.4.
Shows how to pass variables from the PHP and Drupal side over to the front-end JavaScript scripts that are running so that you can use the Drupal interface to create customized settings that will appear in your jQuery scripts.
A review of all of the material covered within the jQuery & JavaScript in Drupal series.
Shows the steps involved in converting a regular table into a table that is sortable by columns that you specify.
A review of the Form API properties that provide interactive user interface elements by automatically adding JavaScript behaviors to the form elements.
Goes through how to implement the AHAH framework in Drupal 6 in order to provide more dynamic interactions on a Drupal form.
See how the new JavaScript APIs and ajax framework in Drupal 7 allows you to implement dynamic behaviors without having to register a menu callback in the menu system or to write any jQuery code.
Create dependencies between form elements so that you can show/hide or disable/enable one form setting based upon the form state of another from setting.
Go on a brief tour of other jQuery and JavaScript-related contributed modules that are worth knowing about.