Blog Archives

Getting a Field from an Entity in Drupal 8

 

Tagged with: , , , ,
Posted in Development

Display-only Pseudo Fields in Drupal 8

In the past I’ve been happy to rely on Display Suite to create what I call “Frontend Only” (DSField) fields (which I created via php). These fields appeared in the Manage Displays screens so that site admins can easily drag them

Tagged with: , ,
Posted in Development

Tideways and Xhgui using Lando

While I prefer using Valet+ for my Drupal development, I have been asked a few times to share my Lando + Tideways setup. I can’t go into too many details at this point, because it’s been a while since I’ve

Tagged with: , , ,
Posted in Development

Migrating Into Existing Nodes in Drupal 8, Including Rollback Missing from Source

Please read this entire post (including the disclaimer at the bottom) before you put any of it to use. The site I’m basing this off had an existing set of nodes and a new migration that had the same nodes (and

Tagged with: , ,
Posted in Development

Combining Steps in Behat for Drupal

Lately I have found myself repeating several lines of behat steps over and over again. Here is a sample of the behat code I use to choose a specific checkbox from an entity browser popup:

There are a few steps in here

Tagged with: ,
Posted in Development

Adding Level Number Class to Menu Items in Drupal 8

This is a quick post showing how to add level classes to menu items in Drupal 8. Here’s the result, showing the additional menu--level-N  and menu-item--level-N  classes: Step 1: Create a New Twig template File Determine which Twig template you need to

Tagged with: , ,
Posted in Development

Setting Drupal 8 Node Properties with Behat

The title of this post could also have been “Opening and Closing a Details Element with Behat” or “Clicking Any Element with Behat”. The Drupal 8 node add/edit screen has a number properties on the right side of the screen. I

Tagged with: , ,
Posted in Development

Hiding Country from an Address Field’s Output in Drupal 8

There are two field formatters available on an Address field in Drupal 8: The Plain formatter uses a Twig template file but it would take some work to override with the proper markup. The Default formatter doesn’t use a Twig

Tagged with: , ,
Posted in Development

Tideways and Xhgui in Valet+ (Valet Plus)

This post is for folks who are already familiar with PHP, command line, Valet, Tideways and XHGui. You can see some explanation and screenshots of Tideways and Xhgui in my Tideways and Xhgui using Dev Desktop post if you need a bit

Tagged with: , , , ,
Posted in Development

Access Entity Properties in a Field Twig Template

This doesn’t need much of an explanation. You can use any entity methods as far as I can tell. Here’s an example showing how to get the node ID in a field template:

 

Tagged with: ,
Posted in Development