Developer Zone

Responsive DFP ads

I liked the implementation in this blog post about how to define DFP ads based on the browser window size, its an interesting read, but the part that caught my attention was titled "Showing / Hiding Ad Slots Without CSS" were ads are only defined if the window width is within a certain size during page load.

It would mean that the different advert sizes would probably need to be set up in DFP, but once set up they would only be called by the appropriate device.

EntityFieldQuery stopped working for non-logged in users

I have a block that displays data from various nodes. It does calculations based on a few fields that exist in these ndes.

Recently it stopped displaying for everyone except user 1.

Simple solution was to make sure my EntityFieldQuery was run using the user 1 account by adding MetaData to the query.

I found this in the Drupal.org docs, but I must admit its been a while since I've had to check it out and I think it has been added since

Dopl test page

The Drupal.org project link filter is a tiny, yet useful module, which adds a filter, to facilitate linking to Drupal.org projects.

Lots of us blog about Drupal projects, or mention them in our forum discussions. Linking to a Drupal project, each time it is mentioned is a bit of a pain. This filter lets you write something like "views. module", and it generates a link to views module page (http://drupal.org/project/views).

Drupal 7 Webform Cookbook by Vernon Denny

Image of Drupal 7 Webform Cookbook

Being a developer I must say that I don't often resort to using the webform module, preferring to hand code any forms that are needed on a site, however a collegue of mine recommended using webform to create the form and using hook_form_alter to add in my own validation, submission handlers and other custom functionality, which I thought made a lot of sense.

Drupal 7 Development by Example, Beginner's Guide by Kurt Madel

Image of Drupal 7 Development by Example Beginner's Guide

Having just finished a read through of Drupal 7 Development by Example Beginner's Guide (http://link.packtpub.com/K0y3L9), my first impressions are very good. The author takes quite a holistic approach to some of the more advanced techniques required during a site build and walks through them in a methodical and easy to follow manner.

Helping out with Drupal Accessibility

While a coder may not have a great deal of time or indeed the answer to any of the accessibility problems encountered in using Drupal, there are still numerous ways that some minor coding skills can used to massively help out with the accessibility of Drupal.

While this is written specifically with Accessibility in mind the skills are very transferrable and can be used for any initiative you may want to help out with.

Most new development is happening in Drupal 8 at the moment so you will need to get the latest version of that first:

Boldy Theme Live Preview setup instructions

CAVEAT EMPTOR
This is a very rough start to the setup instructions, more will be added as I progress and full english will be added rather than the rough notes that exist at present

Site Demo

There is a demo site available to see how this theme looks in comparison to the site5 version, it can be found at:
http://boldy.dev.garethalexander.co.uk or http://boldy.d7.garethalexander.co.uk

Git Workflow - An Update

Now that Drupal have moved from CVS to the git versioning system, I realised that my github workflow can get even more of a workout and is doubly useful to me as I can now use it for Drupal contributions as well. The previous workflow is here: Github Workflow.

There are only a couple of differences between using Drupal's git and github.

The only post you'll ever need to test a template

The only post you'll ever need to test a template

The aim of this post is to write a page that contains all the elements of html that I'll ever use. For the purpose of theme development to ensure all elements are properly styled.

The purpose of this HTML is to help determine what default settings are with CSS and to make sure that all possible HTML Elements are included in this HTML so as to not miss any possible Elements when designing a site.

A birthday function

When you get older you need to write functions to help you though the day:

Pages