Recent posts about Code and Coding
What we’re thinking about here at Raised Eyebrow these days. You can subscribe to our blog by RSS, or sign up for email updates.
-
Datadotgc.ca - A Drupal case study
April, 29 2010 CommentsWe recently launched http://www.datadotgc.ca, an open data collection portal for Canada, built to help poke the Canadian government in the right direction, towards something like similar sites in the UK (data.gov.uk) and the US (data.gov). Read David Eaves' explanation of its purpose. For the benefit of the programming and Drupal community, I'm going to run through, with the aid of code samples, the development of the Drupal module to communicate with the CKAN API (which is where the data is stored). I'll also walk through Theming, integration with Google Charts, Tag Clouds and most importantly, caching.
-
Rewrite a Views query
April, 13 2010 CommentsRecently, due to Views lack of ability to OR it's filters together and due to some serious constraints in relation to arguments and relationships, I found myself needing to figure out how to rewrite the SQL of a Drupal view so that I could get the records that I needed.
It seems like there are two ways to do this. You can either rewrite the SQL directly, or try to hack the query object that views provides.
A quick Google search and I ended up on Drupal.org
Which then led me to the Views documentation
From here I was able to deduce that the
hook_views_pre_execute()hook was what I needed.
I created my module and added the hook:
-
Passing a querystring to FormAPI redirect
March, 24 2010 CommentsHere's a really quick and useful trick to know.
Sometimes you might want your form to redirect to somewhere and pass a few bits of information in the querystring, so that you can do something when you get there.
For example, I needed a recent form to redirect depending on which checkboxes were checked to build a certain URL:
-
Job Posting closes soon
January, 5 2010 CommentsVacation’s only just over, but we are hitting the ground running here at Raised Eyebrow, and there are just two days left to apply for our Front-End Developer posting. If you’re passionate about clean code and building fabulous websites, and you’re looking for a position where you can learn from some of the best code artisans in town and work for clients who are making the world a better place, look no further.
We offer a friendly and healthy workplace, a client list that includes national and local nonprofits, mission-driven businesses, and government agencies, and a very competitive salary & benefits package. If you (or someone you know) might be a fit, please check out our posting & send your resume & cover letter in by 5:00 PM on Thursday, January 7th.
-
Using Drupal to deliver video
December, 22 2009 CommentsThere are many ways to skin the cat when it comes to putting video on a Drupal site. I've tried and tested quite a few methods since my first introduction to Drupal 2 years ago. I've used Embedded Media Field as well as Video Filter but finally settled on the combination of FileField with JWPlayer or Flowplayer and in some cases the Media Mover Module for moving files to Amazon S3 storage. I'm going to use our recent launch of the CCPA website as a case study for how we currently handle video delivery. So let's dissect this a little.
-
We're hiring…
December, 15 2009 CommentsWe're expanding our team here at Raised Eyebrow, and this time we're looking for a Front-End Developer/Themer -- someone who loves building websites, and is looking to extend their skills with Drupal and WordPress.
Beyond our roster of fantastic, progressive clients, we offer a positive & healthy work environment, beautifully remodeled heritage office space, and a team of web experts who love what we do and are keen to share knowledge and produce top-notch work.
Intrigued? Know someone who might be a fit? Check out the job description and get in touch.
-
Generic caching function for Drupal 6
June, 24 2009 CommentsOne of the pieces of the Drupal performance puzzle is caching. After weeding out a couple of very demanding sql queries in a busy Drupal site, we decided to make more use of Drupal's caching mechanisms to cut down some of the database load.
Back in 2007, Lullabot's Jeff Eaton wrote a blog post about caching including a sample implementation for a caching function. This function was almost exactly what we wanted, but we wanted something more generic—a function that we could use in multiple places in the same module or template.php file without modification.
-
Strange permissions on Coda file uploads
June, 24 2009 CommentsI've been working with Coda now for a few weeks and it's been going pretty smoothly. There are a few bugs in the software, or they may even be feature requests :) When creating a file locally and subsequently uploading it to the server the file permissions are set to 700. This was causing all sorts of weirdness on a Drupal site that I'm currently theming. This is definitely a bug, however it's pretty easy to overcome. In "Preferences -> Transfers" there is an option to "Set permissions on upload". Set this to 644. This is the recommended permission for files in your theme folder in Drupal. You should now have no more problems when uploading files. If you've already uploaded files, it's pretty easy to change via the command line using the chmod command:
-
Theming multiple value CCK fields in Views
June, 22 2009 CommentsI'm working on a site right now that has a Publications content type, which in turn has a multiple value CCK text field for Author. If more than one author was input I needed them to display as a comma separated list in a view. How do you go about modifying this? My first stop was the theming info link in Views, and that helped me narrow it down to a template file to use,
views-view-field.tpl.php(). But that file didn't allow me to modify the individual fields without getting a whole load of other HTML in the bargain. -
Duplicate results in Webform module Analysis display
June, 9 2009 CommentsI came across a problem with the Webform module recently that seemed initially puzzling but on closer examination was actually quite simple.
The Problem
When viewing the webform results in the analysis page it appeared that there were duplicate values for some fields:

The Cause
TinyMCE. It seems that the webform and it's components may have been created when TinyMCE was disabled and then edited at a later date when it was enabled. The visibility settings for TinyMCE were as follows:
node/* user/* comment/* admin/build/block/*