332 Results
  • Latest
  • Oldest
Article
Posted on 23rd July 2013
Takes about 1 min to read

If you have a Drupal 7 site, then you should be using the [Entity cache][ec] module, here's why: Lots and lots of things in Drupal are 'entities', such as the content, the users, the taxonomy terms and if you're using contrib modules like [Field collection][fc] or [ECK][eck], then those are entities too. Most of the time you have some fields on those entities, then every time Drupal needs to load one up, it'll also have...

Article
Posted on 11th December 2012
Takes about 3 mins to read

Sometimes as a module developer you need to have some code execute periodically, like maybe every day or even once a week. This might be to optimise an external system, or pull in some external data or to compute some statistics every day etc. Drupal provides a very simple way of doing this: hook_cron but if you want your code to only execute say once a day or after 6pm only, then you have to...

Published in: #job queue #cron #Drupal Planet
Article
Posted on 16th October 2012
Takes about 3 mins to read

There are a few write-ups about using Aegir to automate your deployment process notably one from Mig5: Zero-touch Drupal deployment with Jenkins, Aegir, Git, Fabric and Drush. I recently wanted to set this up for our own project, but felt like I could make some improvements. I don’t like deploying branches, because it can be really hard to actually find out what was deployed at a later date, and you can’t reliably re-deploy that previous...

Article
Posted on 17th August 2012
Takes about 4 mins to read

Sorry if you are expecting the 'solution' to be given in this post, but this is basically a brain-dump of where I'm at with this problem, and my thoughts on how I might go about solving it. ### Background First up, a little background on Computerminds and the sort of development we do. We tend to take on a mixture of projects, we have projects where we'll be completely responsible for the entire technology stack...

Published in: #Puppet #Devops #Vagrant
Article
Posted on 1st May 2012
Takes about 2 mins to read

Livereload is one the coolest things to happen to frontend development in the last little while, and actually it can really speed up your work. Basically it re-loads your CSS (and Javascript some of the time) automatically as you make changes. You don't have to make a change and then switch to your browser and manually reload the entire page, change 'notifications' are pushed to the browser where they will trigger that single changed file...

Published in: #Drupal Planet #CSS #Guard
Article
Posted on 24th April 2012
Takes about 1 min to read

When developing we tend to use a lot of different domains to do our work on, I typically will use the .drupal top level domain, so my project URLs look something like: project-name.drupal When starting a new project, one of the annoying things that we have to do is create an entry in the hosts file for this domain: 127.0.0.1 project-name.drupal On Ubuntu there is a really simple way to automate...

Published in: #DNS
Article
Posted on 17th April 2012
Takes about 13 mins to read

This article discusses how we can use a combination of techniques to take the standard 'Confirmation Form' provided by the [Flag][flag] module and get it to load in a modal window rather than on its own page. We'll also extend this form slightly to allow the user to include some additional data before clicking 'Confirm'. As an example we'll use the Flag module to create an 'Abuse' flag that will apply to a comment entity...

Published in: #Drupal Planet #Drupal 7 #code #ctools #flag #modal
Article
Posted on 22nd March 2012
Takes about 1 min to read

This is a real quick one, but so useful! We often want to render a block within content, perhaps as part of a node (maybe in hook_node_view, and then made configurable like a field), but there's no obvious way to do this correctly for any block. Drupal normally renders its blocks per region, so there is no single function to embed a block. I came across this really simple solution by Damien Tournoud in a...

Article
Posted on 8th March 2012
Takes about 6 mins to read

Facebook integration is obviously starting to become a de facto requirement with most web development projects. In most cases the requirements are reasonably straight forward and involve nothing more than including a ‘Like’ button on content, but what about actually adding your own bespoke content to Facebook like [The Guardian][guardian] – bring on the Facebook Canvas App. Canvas Apps are essentially just a way of wrapping some externally hosted content and putting this onto a...

Published in: #Drupal Planet #Facebook
Article
Posted on 6th March 2012
Takes about 1 min to read

Drupal 7 fields are great, but using multiple valued fields and [field collection][fc] you can quickly reach the point of having a form that looks like this: A complex field collection form In this contrived example I've got two field collections and a multi-valued 'Links' field within that. Although it's reasonably clear what clicking 'Add another item' will do in each case, when the form is full of data it can become less so. We...

Published in: #Drupal Planet #fields #Drupalgive