Janak Singh
ApacheSolr search for Drupal on CentOS
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 (janaksingh.com website).
Drupal 5: fix comment permalinks with pagination
having done some more work on making Drupal Froums look nice and work more like a forum, I noticed a potential bug in the way Drupal handles pagination on comments. If you have a node with many comments and you have enabled comment pagination, you will notice:
- After posting a comment in, you are redirected back to page 1, on a multipaged forum topic this is really annoying.
- Permalinks to comments do not work because the comment_form_submit does not pass in the query (page number)
- Changing the comments per page will generate a different permalink for each comment, without creating a dedicated callback and redirecting the user to the specific post (comment/permalink/comment_ID), there doesnt seem to be a fix for this
It is easy enough to redirect the user to (node/NODE_NID?page=PAGE_ID#COMMENT_ID) after a comment gets submitted. Here is what I did:
Drupal 5 - Disable FCKEditor per content type
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
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
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. This was perfect for blog nodes but I wanted more control over the pager and I only wanted nodes to be pulled out from the same taxonomy term as the node being displayed.. fairly simple idea:
Drupal 5: Add Google Lead Conversion Tracking to registration page
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.
