Install Pressflow (Drupal), Varnish, APC and Apache on CentOS 5.5

Submitted by Janak on Sat, 09/25/2010 - 13:50

After having run website on Drupal 6 with Apache+PHP+MySql, I wanted to move to Pressflow so I could harness the added advantages of Varnish.

This is not an in-depth installation guide or a discussion about Varnish or Pressflow, but quick setup commands for my own reference. Please see links at the end if you wish to explore Varnish or Pressflow setup in greater depth.

Drupal 6: Define SEO Meta Tags dynamically using hook_nodewords_tags_alter

Submitted by Janak on Thu, 03/04/2010 - 10:32

Ever wanted to implement or alter meta tags on a custom page or a view? As most of you would have already heard of the excellent nodewords 6.x-1.11 (module which allows users to define their own meta tags for nodes and much more), we will use some of the very useful API functions of this module.

You can actually use the nodewords API to alter, inject and define your own meta data on virtually any page.

Say you have a view and you want to dynamically set the meta tags for that view? easy..

Step 1: Implement the hook_nodewords_tags_alter() hook

Drupal Forums instead of phpBB or vBulletin: A casestudy

Submitted by Janak on Tue, 01/05/2010 - 13:06

For years I have been using phpBB for a busy community website that has over 162490 registered members. It has been a great ride, members are happy with the functionality and ease of use BUT from a development and security point of view it has been a painful experience.

As anyone who has ever installed, hacked and setup phpBB forum will tell you that due to the lack of hooks or modular nature of phpBB you have to hack core to add any additional functions. Prior to Drupal this was "acceptable loss" to me, but I have "come to my senses" and it is something that I would hate to do now.

For one of the work websites ( that is currently running on Drupal 5, we decided to expand the website and expand it to incorporate a forum. Fun times!! After much deliberation and discussions about pros and cons of each package, here is a "must have" that we decided upon:

Must have features

  • Forums must share the same login as Drupal site
  • MUST look and feel like a phpBB/VB forum
  • Private Messenging
  • Private Forums (moderate only - access by role)
  • Email notifications of updates/comments
  • Avatars
  • Post count (in profile and forum posts)
  • Star Ranking (based on post count)
  • Rank Badge (based on role)
  • Custom folder icons (keeping the look and feel close to phpBB)
  • New posts since last visit
  • Custom breadcrumb
  • Banner blocks
  • Ability to cross promote other drupal content types (based on term relationships)
  • Attachments in comments (with limit)
  • Quote
  • Banwords
  • Offsite links open in a new window
  • Advanced search

ApacheSolr search for Drupal on CentOS

Submitted by Janak on Thu, 12/10/2009 - 17:51

At the recently Drupal Camp Prague 09, I was introduced to ApacheSolr as a replacement to the standard Drupal search or the Google CSE.

On most sites the basic Google CSE setup is sufficient, however for some of the more serious "work" websites my colleague Nick and I got experimenting with the Drupal's implementation of ApacheSolr module.

Here is a quick and rough writeup on how it was implemented on work and my personal ( website).

Drupal 5 - Disable FCKEditor per content type

Submitted by Janak on Wed, 11/11/2009 - 13:00

Anyone using the Drupal module for FCKEditor can tell you the number of times its made their life easier. Install and configure it and you have yourself an instant (and FREE) WYSIWYG HTML Editor.

I mentioned in my previous posts, I am currently working on making Drupal Forums look and function like PHPBB. Having installed the superb Smileys Module by Gurpartap Singh I noticed FCKEditor was breaking the Smilie insertion on the nodepages.

Adding Custom Breadcrumb for Drupal nodes

Submitted by Janak on Sun, 11/01/2009 - 11:53

Out of the box Drupal does not add breadcrumb to node pages, in most situations this is not a problem until recently, I had decided to install the excellent Drupal Forums module on one of the work websites. It quickly became apparent that a forum without a logical breadcrumb is not as user friendly, so here is what I wanted in the breadcrumb:

- Link to Home (Only item Drupal adds by default)
- Link to content type view, eg, Forums Home page, Blog Home page etc
- Links to nested taxonomy terms the node is tagged with

Drupal Custom Pager navigation

Submitted by Janak on Thu, 10/22/2009 - 12:13

For my portfolio site I wanted each image node (CCK + imagefield) to have a thumbnail strip of 10 or so images from the same category. Very simple stuff I thought. A quick search and I came across fantastic module called Custom Pagers by Eaton. This highly flexible module provides you a Next and Previous custom pager that you can display in your node pages.

Drupal 5: Add Google Lead Conversion Tracking to registration page

Submitted by Janak on Wed, 09/09/2009 - 12:56

Ever wanted to alter the the registration page in Drupal 5 to add your own bit of custom code or text? For most of the work websites, we use adwords to bring in traffic and as with any campaign, you would want to monitor the success rate etc.

We needed to add a bit of Google lead conversion tracking code (javascript+html) on the website registration page.

Using Nano (Syntax Highlight) for Drupal Module development

Submitted by Janak on Thu, 08/06/2009 - 12:10

I mostly use Eclipse IDE as my main development environment for Drupal, but have got into the habit of using nano (in emergency situations) to patch and edit my Drupal modules. Often I find it frustrating to with with nano without any kind of syntax highlighting, specially when trying to scan through a big module. A little googling around and I found a way to enable PHP syntax highlighting for nano (rather simple):