Programming

31 12 2010 : Clean and maintainable pattern for blocks development in Drupal 6

Clean and maintainable pattern for blocks development in Drupal 6

Drupal7, has finally removed the confusing $op parameters from hooks. And replaced them with a family of related hooks instead; one hook per op.

Here is a way to achieve the same in Drupal 6; by building a simple router in hook_block().


10 11 2010 : Counter queries for complex, none-distinct SQL in Drupals Pager system.

I think everyone knows these moments: You have a problem, a question. And just by asking that question, the answer pops up in your head. It happens to me often, when programming. It is obvious: by asking the question, you have to analyze and simplify the problem. And by doing so

Today, there was another great way Stackoverflow helped me: I had a problem with a Drupal pager-query on a none-distinct SQL query. And right when I was finishing up, the answer struck me.


10 06 2010 : Design principles for creating Good Classes let you write Good Drupal Modules.

Drupal is not object oriënted (OO). No really, it is not! It merely borrows some design principles from OO, and uses some design concepts (such as the Observer Pattern, or hooks, in Drupal) from OO. Though many Module developers actually use another design principle, that of Classes. When creating a module, one can borrow almost all ideas from the (good) design of classes, to create a good design for a module.

Maybe you think: “Why should I design my module”?


04 01 2010 : Ideal Payment API

iDeal is a Dutch, online payment system, widly adopted, but hard to implement.

In Drupal there are several iDeal implementations for übercart, but none are very solid and none are easy to implement. Moreover: the iDeal übercart implementations lack some error handling, which may not matter for smaller sites, but for large payment flows, this is far from ready.


25 07 2009 : Good commit messages

Git Cola provided a very nice dialog explaining me how to improve my commit message:

A good commit message has the following format: - First line: Describe in one sentence what you did. - Second line: Blank - Remaining lines: Describe why this change is good.

I did some additional research and found some good other guidelines. from stack overflow


27 09 2007 : Snipplr Drupal's code snippet feed

Nice tip for all the Drupal hackers out there: snipplr code snippets for Drupal. It also has an RSS feed. Obviously, as with any unknown source, one should never ever use these snippets (except when you know PHP well).

Oh, and there is a nice jQuery feed too.