Colin Calnan's Blog Posts
-
Show top level terms in a term type view
January 19, 2011 CommentsI recently needed to create a view of type "Term" that displayed taxonomy terms and their description for a certain vocabulary.
The setup for that was quite simple
- Create a view of type "Term"
- Add an argument of Vocabulary ID
- Add a field of "Term Name" and another of "Term Description"
- Add a filter of "Vocabulary" and select the vocabularies you want to restrict to
This gives a nice simple view of all terms belonging to a single vocabulary when the vocabulary id is passed as an argument.
The problem I had here is that this view shows all terms, and I just wanted to see the top level terms in a hierarchical vocabulary.
I instantly went looking for a depth modifier filter or argument handler, but no such luck, you just can't restrict to a level in the hierarchy.
-
Come work with us, you'll love it here
October 22, 2010 CommentsI'm super excited about the the job we've just posted looking for a Project Manager.
I was thinking about why I applied for a job at Raised Eyebrow all those years ago and I also remember a conversation I had with our latest Eyebrower just this week about working here where it reinforced to me why it's great to work here.
-
Tackling the Drupal 7 issue queue
August 4, 2010 CommentsI recently attended the Vancouver Drupal 7 Code Sprint/Workshop to try to help out with tackling some of the critical issues left on the Drupal 7 issue queue. The sprint was organized by Audrey Foo and Chris Ng and hosted by FCV at their offices in downtown Vancouver. There were of course two Drupal stars in attendance, Angie 'webchick' Byron and Károly 'chx' Négyesi. Both of whom have probably more experience between them than all of the Drupal people I know combined.
-
Datadotgc.ca - A Drupal case study: Part 2
June 23, 2010 CommentsThis is the second part of Drupal Case Study on integrating the CKAN data repository with Drupal 6. Part 1 covered the following:
-
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:
-
DrupalCon Sessions to help you manage your business
February 26, 2010 CommentsDrupalCon San Francisco 2010 is just around the corner and Raised Eyebrow hopes to "own the podium", sorry I couldn't resist. Chris and I have been to 2 Drupalcon's so far in our Drupal lifetime, and have decided it is time to give something back. We've come up with 2 Session Proposals that are overviews about how we used Drupal to create two killer applications for managing a small Web Business.
One stores all kinds of client information; FTP connection info., Drupal logins, client contact info., newsletter provider and vendor info. The other is an online training manual for our clients, enabling us to train them remotely, give them access to it wherever they can find a browser and reduces the need to print large binders that end up getting lost or in the landfill/recycling.
So if you're interested in hearing more about these the please go cast your vote by following the links below:
-
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.
-
Ubercart & Content Type machine names
November 18, 2009 CommentsIf you use Ubercart on your Drupal website you may be familiar with product classes. Ubercart has, by default, a product content type, however say you have other content types on your site that you want to sell, you can create product classes from those - http://www.ubercart.org/docs/user/3341/understanding_product_classes.
This works nicely until that moment when you want to rename your content type machine name.. e.g from "contenttype" to "content_type"
I did that recently thinking everything would be hunky dory once I made the change, the results were not so nice. So to help prevent this from happening to anyone else, here's a simple rule to follow before making changes to your content type machine name.