• Cleaner Code with Functional Concepts

    Gabe Sullice

    As developers, we're all constantly searching for the cleanest way to write something. Writing that elegant one-liner or refactoring something ugly gives us a deep sense of satisfaction. Unfortunately, working with Drupal forces us to deal with deeply nested arrays that encourage ugly, cumbersome code. It's just too easy to reach for a trusty foreach loop and plop some conditions inside each one. However, as our codebase matures and new rules are added and exceptions are made, these loops can tend towards chaos.

    Filed under:
     Code
  • Moving Borders with QGIS

    Peter Weber

    Maps seem to describe unchanging massive features— mountains and oceans which will hold their shape for an eternity from a human perspective.

    If you grew up in a country where the political lines haven’t changed in your lifetime it’s easy to imagine they are static, and that the shape won’t ever change. There’s a map on a wall in my parents’ house where the USSR covers the biggest area. There are no countries called Croatia, Bosnia or Serbia and Eritrea is still part of Ethiopia. When politics change, borders are redrawn and old maps become part of history.

    Filed under:
     Code
  • Faster SQL Syncs with Command-line Magic

    Gabe Sullice

    Sometimes, we've got to stop and examine why we do things the way we've always done them. One of the most mundane parts of working with Drupal every day is syncing Drupal databases with Drush. At this point, I think my fingers just write drush sql-sync on muscle memory. There is a faster way though:

    Filed under:
     CodeDrupal
  • An Introduction to Containers

    Gabe Sullice

    Every post I could find was a tutorial that explained how to start working with Containers, but not what they are. This is the post I wish I had found first.

    Filed under:
     Code
  • Drupal 8: Programmatically Adding a Views Footer

    Joel Steidl

    Recently, I needed to add some dynamic content to a Views footer. Specifically, I needed to change a link in the Views footer based on the current path, which isn’t an option from the Views UI. I found some good documentation showing how this can be done in older versions of Drupal (https://www.drupal.org/node/749452), but nothing for Drupal 8. I figured the approach must be similar in Drupal 8 so I started searching and reverse engineering.

  • Drupal 8 Block Cache

    Justin Toupin

    In case you've had trouble tracking it down (I did), the approach to caching custom blocks is different in Drupal 8 than in Drupal 7. In Drupal 8 all renderable arrays are cacheable – including, of course, those returned by custom blocks.

Pages