drupal5

Handling of public and private files in Drupal

20 MAR 2008 / joeri poesen

This article relates to Drupal 5.x

Drupal can handle public and private files. It’s quite good at this. However, when displaying a link to your files, there’s something you should be aware of:

Do not:

<?php 
  print l('somefile', $node->files[0]->filepath); 
?>

Do:

<?php 
  print l('somefile', file_create_url($node->files[0]->filepath)); 
?>

The former will work as long as Drupal’s file system is set to public. Once set to private, it will make you cry.

keywords:

Custom image manipulation in Drupal in just a few lines of code with the ImageAPI module

20 MAR 2008 / joeri poesen

This article relates to Drupal 5.x.

Dopry, maintainer of imagecache, has released imagecache 2.x beta and ImageAPI 5.1.

A little someting about imagecache

For those of you who don’t know imagecache: it’s a very cool module that generates resized and/or cropped versions of images you upload to your Drupal site.

How to add one or more custom submit handlers to a Drupal form

02 MAR 2008 / joeri poesen

The information in this post relates to Drupal 5.x.

In Drupal 5 it's possible, and easy, to play with a form's submit handlers: you can replace an existing handler with your own and you can even add multple handlers if you want.

In human terms, this means that you can change the function that is called when a certain form is submitted and has passed the validation handler (the function responsible for validating the form input).

Why would you want to do this?

keywords:
Syndicate content