328 Results
  • Latest
  • Oldest
Article
Posted on 6th March 2009
Takes about 2 mins to read

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...

Published in: #Drupal Planet #Drupal 6 #Forms #jquery
Article
Posted on 23rd February 2009
Takes about 1 min to read

I'm always hunting around for these various bits every time I do an Ubuntu rebuild - so I thought I would collate them all into one place. This is what we use for our dev boxes, not certified for a production webserver. Note this is specifically for Ubuntu 8.04 - it may well apply to other versions of Ubuntu however. sudo apt-get update sudo apt-get install mysql-server-5.0 sudo apt-get install apache2 sudo apt-get install php5...

Published in: #Drupal Planet
Article
Posted on 17th February 2009
Takes about 1 min to read

One of those little Drupal annoyances this, there is now easy way to alter a comment (using hook_comment) before the comment is written to the DB. Hook comment is invoked during the validation phase, with $op set to "validate", and the comment array is passed by reference - but unfortunately any changes made to the comment are not passed on to the comment save function. A quick and slightly dirty way around this is to...

Published in: #comments #Drupal 5 #Drupal Planet
Article
Posted on 13th February 2009
Takes about 1 min to read

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...

Article
Posted on 10th February 2009
Takes about 1 min to read

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...

Published in: #Drupal 6 #Drupal Planet #Forms
Article
Posted on 7th February 2009
Takes about 1 min to read

We love the views bulk operations module here at ComputerMinds, and frequently use it to create some lovely administrative interfaces. However we often find a need for an administrator to be able to perform operations in a quick and easy way on an individual node. While some of the core operations (publish, make sticky etc) can be performed from the edit tab of the node, many other node operations do not offer this facility ("rebuild...

Article
Posted on 27th January 2009
Takes about 1 min to read

Thought I would post this little function on here, we tend to use it a lot and it gives some nice little extras for you to play with when you come to template your nodes. $node->view_name : the name of the view this node is being rendered in $node->position_in_view : the position within the view for this node function phptemplate_views_view_nodes($view, $nodes, $type, $teasers = false, $links = true) { static $count; foreach ($nodes as $n)...

Article
Posted on 27th January 2009
Takes about 1 min to read

Super quick one this: say you have a CCK field on a particular node whose values you want to ensure are unique across all nodes on your site, you could write yourself a nice little helper module, or some PHP directly into the CCK field validation section of the admin form, but, a helper module already exists! Unique field is a lovely little module that allows you to say that a particular text, number or...

Published in: #CCK #Drupal Planet #fields #node types
Article
Posted on 24th January 2009
Takes about 1 min to read

One for the small but handy category this. The standard "more" link the views module adds to it's blocks has no place on a modern accessible website, you really need a more verbose link in there. One solution has always been to add a bit of footer or header text into the block, but it's a little tedious - and clients always find views hard to edit. This simple solution will turn the block title...

Article
Posted on 21st January 2009
Takes about 2 mins to read

So you've got a nice new version of Drupal 6 and you're building a form, but you want to allow users to upload a file. Of course this is easy with Drupal, and we covered how to do just that, but for Drupal 5, in our previous article: Example code to build an upload form in Drupal. Here we show how file uploads are done in Drupal 6. Honestly, not much has changed, here's the...

Published in: #Drupal Planet #upload #upload form