Latest Blog Posts

Importing Images Within an RSS Feed Using the Drupal 7 Feeds Module

Yes, a blog post about Drupal 7!

I recently worked on an enhancement for a large multi-site Drupal 7 platform to allow its users to import news articles from RSS feeds. Pretty simple request, and given the maturity of the Drupal 7 contrib module ecosystem, it wasn't too difficult to implement.

Tags: Drupal Planet, Drupal 7


Keeping a view of upcoming events fresh in Drupal 8

Imagine you have a view that lists upcoming events on your Drupal 8 site. There's a date filter that filters out any event who's start date is less than the current date. This works great until you realize that the output of the view will be cached in one or many places (dynamic page cache, internal page cache, varnish, etc). Once it's cached, views doesn't execute the query and can't compare the date to the current time, so you may get older events sticking around.

Tags: Drupal Planet


Preventing Drupal 8 from applying image styles to GIFs to preserve animation

I'm working on a site where the editorial staff may occasionally produce animated GIFs and place them in an article. Image styles and animated GIFs in Drupal don't play nice out of the box. Drupal's standard image processing library, GD, does not preserve GIF animation when it processes them, so any image styles applied to the image will remove the animation.

Tags: Drupal 8, Drupal Planet


Escaping input for custom Twig Functions

I have a custom Twig function that will output a question mark icon with tooltip functionality from bootstrap. My Symfony twig extension class looks like this:

Tags: twig symfony


Using the "Dynamic Cache" Module to Programmatically Disable Page Caching

I recently worked on porting over a website to Drupal that had several dynamic elements throughout the site depending on the IP address of the user. Different content could be shown depending on if the user was within a local network, a larger local network, or completely outside the network.

Tags: Drupal 7, Drupal Planet