Managing WordPress with Composer

With the introduction of Drupal 8 the Composer package manager became the goût du jour for me. And once you start using Composer to manage your PHP-projects you never want to do it any other way. 

So how do you go about it if you  want to spin up a WordPress site using composer? There is plenty of useful information to be found on the internets, not least from the competent people at This piece was written all the way back in August of 2013, but still seems to be the best summary out there:

This is how you install Drupal Console

Drupal Console is a command line tool derived from the Symfony Console and let's you debug, and interact with Drupal as well as create "boilerplate" code.

Once you've installed Drupal Console you should be able use it to create modules and services among other things. A nice time saver. This is how you install it. 

1. Use your Terminal to download the latest version of Drupal Console

curl -L -o drupal.phar

2. Verify that the drupal.phar file works

Drupal 8 Learning Series: 2. Disable Cache in a Devel Environment

If you've developed in Drupal before you're familiar with the classic question "have you cleared the cache?". If you haven't developed in Drupal before, let me ask you this: – Have you cleared the cache?

To do any kind of decent development you need a non-cached environment, so that changes you make to the code are reflected upon reloading in the browser. In this second article of the Drupal 8 Learning Series we'll look into how to configure your cool new D8 project for development.

Drupal 8 Learning Series: 1. Create a child theme

Where should an aspiring web developer who wants to try out Drupal 8 begin? In a series of posts I’ll walk you through a few basic exercises to help you get acquainted with Drupal 8.

If you’re already a real pro scooting around D8 in your coding skills equivalent of a jetski – this content is clearly not for you. But if you feel a bit lost where to start and want to try out some basic Drupal development you’re welcome to read along.

Filter content in a Drupal View with AJAX

When displaying Drupal content through Views you’d sometimes like the user to be able to dynamically filter the content from a list of links. Ajax is already part of Drupal 8 Views. This is how you change the default <select> list into themable links.

Update 2018-01-05: Some of my readers have had trouble getting this to work properly. So I've added a demo module that you can download from GitHub to get working code including a preconfigured view. Remember to clear Drupals' cache after installing it.

Sanitize names of uploaded files in WordPress

Nothing worse than user contributed image files with strange (non-english) characters in the file name right? Here's what you can do about it in WordPress.

If you are working with WordPress Sites in non-english languages, like for instance Swedish, like I am, sometimes there can be a world if pain when moving sites between hosts if the file names include non-standard charachters such as åÅ, äÄ, öÖ. The images appear as broken, becuase something with the file name encoding happens along the way.

Adding Apple touch icons to your Drupal 7 theme

What is an apple touch icon? It's basically the same thing as the good old favicon.ico. Only it is specifically targeted for Apples iOS devices. This is how you add touch icons to your drupal 7 theme.

An Apple touch icon is the image being used when someone bookmarks a page or adds it to their homescreen. The most prominent exposure I get to touch icons is when I'm opening a new window or tab on my iphone, then I'm usually presented with a neat looking collection of icons from the web sites I frequent often.

Pimp your Espresso

I do all my CSS with LESS and Espresso right now. So it is essential for me to have Less Syntax in Espresso. Here is the best "sugar" I've found for Espresso so far (see attached file).

Pimp your Espresso  I found it through this link