Supplying Thumbnails to your Headless Drupal Front End
The Drupal 8 dev team decided to include the REST module in core because of the growing movement towards decoupled architecture, which we often refer to as “Headless Drupal.” Along these lines, entities have built in REST support, and furthermore it is extremely simple to expose custom lists of entities as REST resources by using the Views module REST display type. Drupal 8 is thoroughly headless-ready.
Drupal Bits & Bytes: Adding Content in an Update Hook
If you’ve ever worked on a project in a team setting that uses the local/development/staging workflow, you probably know that it can be difficult to keep test content synced between databases.
Pro Tip: How to Write Conditional CSS for IE10 and 11
While working on recent Drupal projects, I learned that Internet 10 and 11 (IE10-11) no longer support IE conditional comments. Conditional comments allow us to target specific versions or version ranges of IE to correct bugs or inconsitentices that normally are not present on other browsers. Typically for IE9 and below, we have been able to write conditional css by using something like this:
Responsive Images in D8
A few months ago I wrote about how combining the picture element module with the breakpoints module can help you manage images in a responsive Drupal 7 website more efficiently. As a follow up, I wanted to write about how Responsive Images has evolved within the Drupal ecosystem. This time however, the focus will be on Drupal 8— though most of what I will cover also applies to Drupal 7 with some minor differences.
Dev Hacks: My Other Office
All that I need is my laptop and the internet to work on Drupal sites, communicate with colleagues and clients, and learn and grow as a Drupal Developer, but every once in a while, I find the need for an additional office.
Drush-Fu Aliases that Work Across all Environments
Have you noticed how your remote drush aliases (e.g., @my-dev-server) don't work when you're logged into the remote server? It's because aliases with the "remote-host" key specified can't work locally. Quite annoying!
A better Access Denied (403) page with Panels
What happens when a user bookmarks an access-protected page? If their session expires before they next visit the bookmark, they'll see an "Access Denied" message with no login form. How confusing for the end user! Let's change that.
How To Do A Combined Name Search
Recently I developed some functionality for a client that I realized might be useful to the greater Drupal community. This post describes how to set up a combined fields filter in Views to allow searching for terms and matching more than one field.
Let’s say you have a single search box and you want to be able to match more than one field, in this case, a user’s first, or preferred name (both different fields on the user entity). Using a view with exposed filters to show the results, we can use combined filters to make this possible.
Conditionally Open a Link in a New Tab in Views Without the PHP Filter
I had a task. It seemed simple enough. It involved a link field with a title and a url (created by the Link module) and a single on/off checkbox field. The checkbox was a toggle for whether the link should open in a new browser tab/window.
Configuring Views to Display Repeating Date Fields
Configuring Views and Date is a simple enough task for any reasonably experienced site builder, but I’ve found that configuring Views to correctly handle and display repeating events is another matter. To get us started, I’ve installed the following modules:
- Views
Views UI
- Date
Date Repeat Field
Date Views