Drupal articles

Views content cache

12th Jun 2010

Views is awesome. You get a ton of flexibility and power, but that comes at a price: Some of the queries that views produces are less than optimal, and the rendering of results can take a long time. Views 2.6 introduced a nice solution to some of the issues, with the introduction of caching plugins.

Views itself comes with a single cache plugin (okay, okay two if you're really counting) that is time-based. So you can say: "I don't care if I show content that's 6 hours old" and it'll handle it fine. I've been thinking for a while that...

Read more

Drupal(Vol)Con 2010

27th Apr 2010

Computerminds were due to attend the latest DrupalCon over in San Francisco, however Eyjafjallajokull had other ideas. With planes grounded and Europe at a standstill (in the air) we couldn't make it.

However, an amazing bunch of people came together a couple of days before the start of Drupalcon proper to set up: DrupalVolCon London.

DrupalVolCon was really cool, we watched the drupalcon keynotes from SF on a projector, and ate lots of pizza. We also presented sessions to each other, unconference style, here are some of the highlights:

Read more

Automating boring tasks with Selenium IDE

20th Oct 2009

If you need to perform the same repetitive task on a bunch of nodes you can script the operation using PHP, but sometimes it can take a long time to write and test the PHP and even then you have to get the script to the server and execute within a certain time etc.

Instead, you could use the testing tool Selenium. Selenium Remote Control can be invoked from a language such as PHP so can easily perform loops, but Selenium IDE has no such functionality out of the box. However you can add a simple extension to the...

Read more

Nodequeues for developers

27th Aug 2009

Nodequeues are a really useful way of building ordered lists of content and they integrate amazingly with views and have quite a nice interface for adding/removing nodes. Out of the box you can create queues and choose node types that can be added to the queues, and roles that can manipulate the queues, with a little more effort and some code you can do a lot more. We had built a media competition feature for a client; they can create a competition into which users can post photos or videos that can then be voted and commented on. However we...

Read more

Hudson and Simpletest

21st Aug 2009

We've recently set up a Hudson Continuous Integration build server to help us with testing our sites. We got selenium up and running fairly quickly, it installs and tests all the sites and Hudson has aplugin to report the results from selenium tests. But we also wanted to run simpletests and report those results too. This article explains how I've set it up on our server, and will hopefully give you a head start on the way to getting it set up on yours.

The problem:

  1. Run simpletests from the command line.
  2. Integrate the results with the Hudson's...
Read more

Using Drush export content type, and views

6th Jul 2009

We're not sure what to do with these: we've written two simple Drush scripts for exporting content types and views. Saving us from having to navigate a few pages and precious seconds.

Download them and pop them somewhere Drush can find them, a good candidate would be in ~/.drush

Then you can run them by typing:

drush export view <view_name>

or

drush export content type <type_name>

You should now either have an error message or and exported view or content type in a file. The files are saved in the current working directory (in most cases where you ran drush...

Read more

Extending the drupal context module to allow conditional contexts based on taxonomy terms

30th Jun 2009

We are loving the Drupal context module here at ComputerMinds, it puts a lovely user friendly formal front end onto creating context's for your site, something we had previously been doing with various snippets of code. If you haven't come accross the context module before then I fully recommend you have a look at this post http://www.developmentseed.org/blog/2008/apr/09/context-ui which explains all ...

Taxonomy based context

The one key element that seems to be missing from context is the ability to set the context based on taxonomy, but no fear - the context module is super easy to extend and this just...

Read more

Drupal update hooks in a multi developer environment

17th Jun 2009

With large Drupal projects, especially those in their post-live phase, good code and release managment becomes vital.
Update hooks provide the mechanism by which database changes can be scripted and deployed to the live server, this article assumes you are already well versed with the ways of update hooks.
The two main problems we have with update hooks occur on multi developer projects

Same function is implemented in 2 branches. Imagine the situation where you have 2 seperate branches open on the same project, with different developers working on each branch.
Both branches want to update the module crm_integration so...

Read more

DrupalCamp day 2

17th Jun 2009

Day 2 at Drupalcamp UK was as packed with goodness as the first day, here's some of the highlights:

Integration with 3rd Party Applications

In this excellent session given by Adam Evans common techniques and pitfalls for integrating applications with Drupal were covered. There were some really good tips, including using Solr to search external data held in a e-commerce system and using the Drupal Apache Solr module to pull that data into a Drupal page.

Form API

This session at Drupalcamp UK was given by our very own computermind: Steven Jones. He took a quick poll, and people wanted...

Read more

DrupalCamp day 1

15th Jun 2009

A brief summary of some of the cool stuff I picked up from day 1 at DrupalCamp, interestingly most of it wasn't necessarily Drupal related ... day 2 and pics (featuring lots of ComputerMinds lanyards!) etc to follow ...

Hudson - a tool that automates builds, running of unit tests, running of jmeter performance tests and some other loveliness. Configure it to run periodically against your various SVN branches (works with other SCC systems (Git, CVS etc) too I believe). It even has front end with little weather style graphics, rainy if its broke, sunny if it's good, cloudy if...

Read more