
The articles on this page are ComputerMinds' contribution to the Planet Drupal aggregated article feed. Planet Drupal is intended to collate interesting and useful Drupal content from around the web.
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)...
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...
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...
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...
If you're still stuck in the Views dark ages, and 1.6 is as good as it gets for you here's a quick tip to make things a little easier: Exporting your views You've just spent a good hour creating and tweaking that view until it shows exactly the right thing, and now you want to save it for posterity, portability and all that jazz. Simple. Click on the 'Export' tab within Views and you'll get...
We have recently started using Mollom on our Drupal site. Mollom is a clever anti spam service, that combines auto SPAM detection techniques with a normal CAPTCHA. The idea is simple, Mollom will check form submissions, if it thinks something is SPAM then it will prompt the submitter to complete a CAPTCHA. This means that you don't risk losing valid submissions to an over aggressive SPAM filter, and you don't risk scaring off users with...
We are big fans of SugarCRM and have worked on a number of projects to integrate SugarCRM with Drupal. This is a simple guide to performing a basic data capture integration between Drupal and Sugar, using a couple of Drupal modules (webform and sugarwebform). You can see an example of this on our contact us page - feel free to fill the form in, but it is our live contact form so don't be suprised...
We had a problem today with tinymce on Drupal 6, with a large number of buttons enabled the width of the tinymce button area just kept on growing - not pretty Adding the following CSS to our Drupal 6 theme solved the tinymce button problem .defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td { float:left; } .defaultSkin table.mceToolbar{ float:left; }
We came across this problem on one of our Drupal sites the other day, someone uploaded an image with an ampersand in the filename, and imagecache refused to display the image. A bit of investigating revealed that imagecache had a problem with a number of special characters in the image filenames. The solution is a little imagecache theme override - you can see examples for both Drupal5 and Drupal6 below Drupal 5 version function phptemplate_imagecache($namespace...
Small one this to compliment our other article on removing tinymce from select textareas. This enhancement will hide tinymce from the Drupal block edit screen when the input format is set to PHP. This stops the problem of tinymce stripping the PHP tags from the block edit textarea when you edit your block The following function goes into your template.php file and will solve the problem of tinymce showing up on a block when the...