Skip to main content

Articles tagged with "Drupal 6"

Changing Display Suite fields in update hooks

10th Feb 2011

We've been using Display Suite with Node displays on one of our latest sites. It was an experiment, and possibly not something we'll do again - DS offers some great functionality with build modes and ways to re-arrange fields and all sorts on nodes, but since we end up theming most nodes quite a lot anyway, it's not worth the extra hassle that Display Suite can add when you want to change the theming on DS fields, layouts, change the fields' settings etc...

We use update hooks to change most things on sites for clients, since this allows us to...

Read more

DrupalCon DC - Business Analytics in Drupal with Views

12th Mar 2009

One of the interesting sessions that I attended at DrupalCon DC was one entitled: Business Analytics in Drupal with Views. In it, the presenters showcased two of their modules. One was a charts display plugin for views, and one was a 'group by' views field.

Views charts

This was a simple module to take the output of a views query and pump it into a flash charting framework. Being able to display the output of your views with charts is really nothing new, and the presenters admitted to duplicating existing modules. Hopefully a module will emerge from the mess...

Read more

Quick Guide to using drupal_add_tabledrag and enjoying jquery drag and drop loveliness

6th Mar 2009

We are finding that the feature exciting most end users in Drupal 6 is the lovely new jquery based drag and drop, as seen on the blocks and menu edit pages - we will be quite happy never have to explain the concept of "weights" again. The best news is that you can add this functionality to your own forms for free - and here is how.

Build and theme the form

We are assuming your vaguely familiar with the form API - you can brush up here http://api.drupal.org/api/file/developer/topics/forms_api.html - so we won't go into too much detail here. Essentially...

Read more

Views 2: Making a drupal views block title link back to the view

13th Feb 2009

We wrote an article about linking a view's block title to the companion page view, in Drupal 5. Someone asked for a Drupal 6 version, which can be quite easily done with a preprocess function, but it's not very flexible.

Instead we just need to create a new display plugin for Views 2, and that will allow us to be much more flexible in our approach.

This is my first display plugin, so it may be completely broken (though it works for me!) You'll just need to download and install the attached file like any other module.

Instead of...

Read more

Drupal 6 - Multiple instances of the same form on one page

10th Feb 2009

There's an excellent article over on gtrlabs: Drupal 5: How to process multiple instances of the same form on the same page that describes in detail how to have multiple copies of the same form on the same page. There are some subtle differences to use this technique in Drupal 6, which I'll explain below.

The idea of this technique is simple, drupal forms are identified by their 'form_id' and these ids must be unique on a page, so if you want the same form to appear more than once, you need to change the 'form_id' somehow. We do this...

Read more

Displaying exposed filter form for views in Drupal 6 (views 2)

15th Aug 2008

One of the joys of working with Drupal 6, and views 2, is that you have to relearn a lot of things you used to take for granted ... one trick we use in most projects is embedding views filters in blocks, nodes or custom code. There are plenty of scenarios this is useful, the classic being to create a flexible views based replacement for the normal Drupal search. Anyway, enough of the blurb - heres the good stuff - some code to give you the filter form for a Drupal 6 views 2 view.


  $view = views_get_view('your_view_name');
  $view->set_display('default');
  $view->init_handlers()...
Read more