Drupal
Modify Recent Comments Block in Drupal
Submitted by vaibhav on Sat, 02/27/2010 - 03:36When I launched this blog in Drupal, I knew, I would be modifying its "Recent Comments" Block someday. I did'nt like Drupals default "Recent Comments" Block. It only display, subject of the comment with its posted time.
But I wanted a lot more. I wanted to display the "'comment author'(linking to author's homepage) added a 'comment' (linking to comment) to 'Title of the post' (linking to the post) (Time ago). I also wanted to separate Comments according to the node types. Comments on the blog entry and Forums should be shown in a differnt blocks.
Syntax Highlighting using GeSHi Filter and FCKeditor in Drupal
Submitted by vaibhav on Tue, 02/23/2010 - 14:54When I was developing this site, I knew I would be publishing a lot of Source Code. After some googling I foung GeSHi Filter for Source Code Syntax Highlighting. This module integrates the third party PHP library GeSHi (Generic Syntax Highlighter) into Drupal. GeSHi Filter, syntax highlight your source code between <blockcode>tag.
How to do Numeric Validation in Drupal Webforms
Submitted by vaibhav on Sat, 10/10/2009 - 11:13I spent a lot of time to figure out How to restrict only numeric data in drupal webforms. To my surprise drupal does'nt provide such functionality. But we can achieve it through Additional Validation in Webform Advanced Settings.
Just write this PHP code in additional validation.
$mobile_no = $form_values['submitted_tree']['mobile_no']; if (strlen(trim($mobile_no)) > 0){ if (!is_numeric($mobile_no)) { form_set_error('submitted][mobile_no', t('Mobile No. must be Numeric')); } }