No time of day in node date

It is common to wish to remove the time of day shown in the node “submitted” line. In Drupal 5, there were no less than three ways to achieve this, and I will present these when I'm done covering date formatting for Drupal 6. Drupal 6 allows you to modify the different formats for dates in the Administration area of your site, these different formats being small, medium and large — yep, just like pizza, oh... my... god... You could do the same in Drupal 5. However, you then had to pick among a finite list of options. In Drupal 6, you can create an nth option, if you like none of the options presented to you. Read more →


Quick edit and delete links for the Administrator

You want to add quick edit links to the teaser view of your nodes — one link to edit the node, and another to delete it, and you want these links to be shown only to users with the 'administer nodes' permission. Alternatively, you may want these links to be viewed only by the user with uid (user ID) 1. Read more →


Displaying the content type name

You want to print the content type name along with the 'submitted' info. This will be particularly useful for those who have created custom content types, with or without CCKRead more →


Theming comments by the node's author

You want the comment style to be different for comments added by the author of a node — who's commenting on his own node. For example, you may want to highlight the node's author's comments, so that any visitor skimming through the comments will easily differentiate them from other comments. Read more →


My top 10 favorite theming tweaks for content

Here is a collection of my 10 favorite 'tweaks' to content template files in Drupal 6. I will add one simple tweak a day, starting today.


File download in Drupal

The attached ebook, Files in Drupal, has been expanded and updated to account for changes in Drupal 6.
Update, May 10th, 2008.

You'll find in the pdf document attached to this posting “10 things you ought to know” about file download in Drupal, from a developer’s perspective. This small guide provides sample code, recipes, concise yet complete explanations, tricks, and a thorough coverage of the module hook function file_download. The document is 6 11 16 17 pages long, it has been expanded and updated to account for changes in Drupal 5 and 6. I also added a 'funny' cover to the book. (My modest attempt at humour.) Typos are corrected pretty much on a daily basis... If you’ve downloaded the document before May 17th, 2008, please redownload it. Read more →

One file is attached to this posting. Login or register to download this file.


New Drupal theming ebook

I’m currently working on a Drupal 6 theming ebook. The beta ebook attached to this posting is for Drupal 5.
Update, March 29th, 2008.

I am in the process of writing a 50-and-some pages ebook on Drupal theming. I have an outline and a spiral book full of notes, and lots of sections are already written. My current draft (call that a beta-book) is 15 pages long and if you log in you may download it. Read more →

Because you are not logged in, you cannot see the 2 files attached to this posting. Login or register to download these files.


Packt Publishing Drupal 5 Themes reviewed

A first release candidate of Drupal 6 was made available on December 20, 2007, that is, two days prior to the publication of this theming guide... which covers Drupal 5! Drupal 6.1 has since been released, and many of Drupal’s most popular add-on modules are now ready for use on production web sites. The author mentioned on his blog that an updated version of his book will be published, but Packt Publishing is not yet listing 'Drupal 6 Themes' among its upcoming publications. Still, I read the book, and worked through its examples on a Drupal 6 install. As a somewhat seasoned Drupal developer, I still found the book helpful. I recommend it, provided that, as you read along, you refer yourself to the concise (and well-put-together) Drupal 6 theming guide available on Theming has definitely taken a leap forward in D6. For instance, intercepting and overriding theming functions is a lot easier now.

I bookmarked quite a few pages in the book Drupal 5 Themes.

 Read more →


True or false in php

I thought I knew what qualified as a false statement in php. I thought that any undefined variable, or any integer or float value equal to 0, was false, and believed that everything else was true. I was wrong. This article serves two purposes : the least of them is to inform you, because you probably know better than I do, while the principal aim is for me to play with Javascript in Drupal... because I have prepared an interactive challenge for you.

Let’s begin by examining sample code. Read more →


Where are we ?

Say we are in a block. Or say we are in a node’s body or teaser. We may ask ourselves : where am I ? On this page, whichever page, is there a node displayed ? If so, which node is it ? Or is there a list of nodes displayed ? If so, what kind of list is it ? Is it a list of nodes who share the taxonomy term “news” ? To answer these questions, one needs to understand Drupal’s path system. Read more →