Skip to main content

Working with Drupal views

The views module is what always brings a smile to peoples faces when we do our Drupal training, even the most die-hard anti-CMS I-want-to-write-everything-myself-in-raw-PHP developer grudgingly offers up some praise when we do a demonstration.

We've been using views since the dark ages of Drupal 4 all the way up to it's inclusion as a core module in Drupal 8. I don't think we have ever built a site without at least a couple of custom views, and most have a few custom views handlers thrown in to handle those cheeky listing or exporting situations.

We've blogged a bunch about Drupal views over the years, you can read it all below ...

Read some of our articles about Drupal views

Multilingual views in Drupal when using i18n module

1st Mar 2008

Building multilingual sites in Drupal using the i18n module always throws up a few fun problems to be solved. One of the most awkward being views.

The i18n views integration module does an excellent job of allowing you to return only nodes matching a particular language, but it doesn't help when it comes to translating the view itself - and more importantly allowing a view to site nicely into multiple positions in the menu (one per language).

The solution is to use the excellent insert view module (http://drupal.org/project/insert_view - you can use this guide to get the module and...

Read more

Drupal - changing the calander view to display single letter for day of the week

30th Nov 2007

By default the Drupal event module will provide a nice calander block, listing the days of the week accross the top using 3 letter abbreviations (mon, tue etc).

This little theme snippet will override this default behaviour and display the first letter of each day of the week (i.e. M T W) etc.

Pop the following into your template.php file and you should be in business


function phptemplate_event_calendar_month($op, $header, 
$rows, $attributes = array(), $caption = NULL) {
  //run through each item in the old header and just use the first letter 
//instead of the entire word
  foreach ($header as $item){...
Read more