Cron Queuing in Drupal 8

Day 7 focuses mainly on the Drupal Queue API. The main resource for this card is an article called Drupal 8 Queue API – Powerful Manual and Cron Queueing, which I had referenced in an earlier post. Before completing any of the materials, I had no previous experience with the Queue API, nor hook_entity_insert, which was used to create a demo queue system in the referenced article. After going through the article I gained a better understanding of how the queue system works. At a high level the following steps outline the process of constructing the module that is documented in this article along with relevant links to the API. ...

August 13, 2016 · 5 min · 963 words · icarnaghan

Services and Dependency Injection

For several years I have worked as an ASP.NET MVC developer and have become intimately familiar with terms such as services and dependency injection and services. It is refreshing to see some of these familiar concepts surfacing in Drupal 8. Day 6 focuses mainly on introducing us to services and dependency injection via several online resources. There is no exercises or tasks in this card as the aim is to simply gain an understanding of some of these concepts. I saw a lot of overlap in terms of syntax and how dependency injection is handled in Drupal 8 compared with Unity and StuctureMap in ASP.NET, so anyone from background or other traditional object oriented languages such as Java will be familiar with a lot of this. I have outlined the main takeaways I got from the Day 6 below. ...

August 12, 2016 · 6 min · 1071 words · icarnaghan

Drupal 8 Migration

I have had some exposure to the migrate module in the past, mostly with Drupal 7 and more recently for a Drupal 8 migration project that required importing of a small (under 1000) set of records stored in a CSV file. Todays D8Card focuses on the new migration module that comes partly with core and also partly in the form of contributed modules. Migrate Core & Migrate Contrib The purpose of todays set of tasks was to import a couple of small CSV files using migrate and some of the contributed modules. I started out by reviewing the links posted in the card and then proceeded to download and install migrate_tools, migrate_plus, and migrate_source_csv. What comes with Drupal 8 core out of the box is pretty limited and only contains migration functionality for moving content from previous Drupal sites. It definitely makes the upgrade process less painful, however if you want to get into migration code that can manage a multitude of external sources, then you will want to grab to contrib modules above. ...

August 11, 2016 · 6 min · 1071 words · icarnaghan

The New Block System in Drupal 8

Among the many changes in Drupal 8, the blocks system received an overhaul, which has improved much of its functionality significantly. Some of the most notable take aways include the new block page layout and UI for updating, adding, and editing blocks, the addition of custom blocks and fieldable types (similar to content types), and integration with display view modes to allow for rendering changes based on block placement. Day 5 directs you to a good introductory video of the new blocks system by the Drupalize.me team. ...

August 11, 2016 · 4 min · 722 words · icarnaghan

Building Configuration Forms

In Day 3 we are starting to accelerate in terms of skills developed by the cards. This card has us create our first Drupal 8 module, learn about Drupal 8 Form API and learn about the Configuration API. The card starts off with directing you to several Drupal.org documentation pages including Creating a Custom Page, Defining and using your own configuration in Drupal 8, Providing Default configuration, and Simple Configuration API. Except for the Creating a Custom Page document, everything else here is focused on giving you a solid overview of the configuration system within Drupal 8. ...

August 9, 2016 · 5 min · 1036 words · icarnaghan

Paragraphs Module

I have to be honest, before completing Day 2 tasks, I had never actually used the Paragraphs module before. I heard others mention it in the past and considered looking at it at some point, however until today I did not realize what I was missing in terms of the power and flexibility that this module has to offer. The d8cards.com Paragraphs Module card begins with directing you to YouTube tutorial by Zane Sensenig, embedded below. ...

August 8, 2016 · 3 min · 573 words · icarnaghan

Drupal 8 Configuration Management

THE 21 DAY CHALLENGE I’ve been trying to learn Drupal 8 for the last couple of months as I was landed in the middle of a D8 project at work. Being involved on the project has taught me a lot about Drupal 8 module development and Symfony in general, however I have started questioning the way I am writing code and if in fact it is the best way or the ‘Drupal’ way. I decided I needed some additional exposure to Drupal 8, not only in terms of module development, but as a platform in its entirety including front-end, configuration as well as back-end. ...

August 7, 2016 · 2 min · 285 words · icarnaghan

Xdebug + Scotchbox Vagrant + PHPStorm in Three Steps

I come from a .NET background where I was spoiled by the ease of use and integration of Visual Studio. Recently much of my development work has moved to the open source and the world of Drupal 8 where I have gotten by until recently with Sublime Text and Atom. Since I have started writing custom modules, I needed a way to effectively debug my code and I had heard good things about the PHP debugger Xdebug. Unfortunately it can be a little tricky to setup, so I have outlined the basic steps I needed to go through using my favorite Vagrant environment Scotchbox. If you are unfamiliar with Scotchbox, check out my earlier posts Scotchbox Vagrant LAMP Stack and Drupal Development Environment in less than 10 Minutes ...

August 6, 2016 · 3 min · 620 words · icarnaghan

Using PostGreSQL with Scotchbox Vagrant LAMP Stack

I have been using Scotchbox for a while now and continue to be impressed by it’s simplicity and ease of use compared to other Vagrant environments I have used in the past. Recently I started working on a Drupal 8 project that required the use of a PostGreSQL (PostGres) database. Thankfully, when I checked the Scotchbox 2.0 documentation, it appeared that PostGres came packaged up with the environment and ready to use. After doing a little bit of research I realized I needed to follow a couple of steps in order to get this running properly with a PostGres client. I am outlining the steps below. ...

August 3, 2016 · 3 min · 467 words · icarnaghan

Drupal Development Environment

Drupal can be installed on any number of environments, but since it was developed primarily to run on an Apache server with PHP and MySQL database, it makes sense to mimic this environment as much as possible in a development sandbox. There are LAMP applications for both Windows (WAMP / XAMP) and Mac OS (MAMP) which can serve as a Linux replacement, however recent innovations with Virtual Machines and Vagrant means that we can re-create a more native environment for development quickly and easily. Below I will describe how you can setup Drupal using some of these tools in less than 10 minutes. The Vagrant setup used here is Scotch Box. The objective is to setup a Drupal development environment with full LAMP stack capabilities including command line access and Drush integration using the native Linux file system for speed and compatibility. ...

May 11, 2015 · 5 min · 914 words · icarnaghan