Blog Archives

Quick and Dirty Debugging of Drupal 8 Migrations

Introduction If you’re working on a migration in Drupal 8 and you’re finding yourself a little confused by the YAML-based configuration, I strongly recommend using a proper debugger so you can step through the code. You cannot step through the YAML,

Tagged with: , ,
Posted in Development

Database Refreshing Pattern in Drupal 8 – Testing Config Changes

I’ve been working on some Drupal 8 migration work. Given that most of the work I’m doing takes place in “config” I have to keep refreshing/reinstalling the config on my site. For a long time I would use Configuration Installer to

Tagged with: ,
Posted in Development

Friendly URL for Views Contextual Filter on a Boolean Field

I have a story content type that has a corresponding Views listing page. The stories can be flagged as Featured through a checkbox/boolean field ( field_story_featured ). The stories also have a Story Type value ( field_story_type ). The views listing page needs to have the

Tagged with: , ,
Posted in Development

Adding an Inline Style Attribute to an Entity in Drupal 7

The point of this post is to illustrate adding inline styles without creating template files. Normally we add classes via $vars['classes_array']  but sometimes inline styles are required. This code isn’t too useful as written (make all text red for all

Tagged with:
Posted in Development

Entity Reference Referrer – Getting Entity Reference’s Parent/Referrer Entity ID and Type

Out-of-the-box, the Entity Reference module doesn’t provide a way to access the referrer entity’s fields from within the referenced entity. I have two ways of doing this. The first is to patch the entityreference module (not ideal unless this patch

Tagged with: , ,
Posted in Development

Triggers in iTerm – Watching For Specific Strings

I was recently performing a git-add in patch mode (  git add -p ) as I normally do, and realized there were a few lines I needed to make sure I didn’t commit. These lines were sandwiched between other lines that I did want

Tagged with: , , , , ,
Posted in Development, Tech Tips

Appending Language to Menu Items in Menu Admin (Drupal 7)

If you are working with a Drupal 7 menu that contains menu items across multiple languages it is a little cumbersome to see them all on the same screen. Right now we have all of the translations in place (3

Tagged with: , ,
Posted in Development

Pointing All Taxonomy Term Links to ApacheSolr Search Results

I’ve been working on a project that leverages ApacheSolr for many of the displays on the site. One of the requirements is that every instance of a taxonomy term link on the site needs to point to search results pre-filtered

Tagged with: , , ,
Posted in Development

Indexing Specific Field Collection Fields in Apache Solr for Drupal 7

I’m not sure how much of this is possible without Display Suite, but here’s the setup I’ve used to index specific fields within a field collection as part of the parent entity. I use the “Search index” view mode to

Tagged with: , ,
Posted in Development

Quickly Implement a Block as a Paragraph in Drupal 7

Disclaimer: As with most tasks in Drupal, there are several ways to do this. My goal here was to see how quickly it could be done without writing code and without introducing unnecessary complexity. Goal — quickly implement a newsletter

Tagged with: , , , , ,
Posted in Development