Skip to main content

Drupal planet

Clearing textfield in drupal

Adding a clear button to Drupal form API text field

We wanted to have a quick clear button for any text field (similar to address bar of browsers in mobile and tablet devices). Snapshot below might explain it much better. In this you are seeing email search field in newsletter filter form.

While I was in search for creating this, I found HTML5 is as the way to go. One can simply create that by using "search" input type. The proper HTML tag for the same is below,

knackforge blog knowledge base

Drupal 7: Invoking custom callback in maintenance mode

In a Drupal site, if we have any module upgrade or configuration related work to be done in our live site, it is recommended to put the site in maintenance mode, so we can prevent end users from experiencing glitches.
 
When the site is operating in maintenance mode, any page request would return only maintenance message. Some pages are allowed to access though. The login functionality for instance will work in the maintenance mode.
knackforge blog knowledge base

How to add contextual link on a block

Contextual link is a nice addition made into Drupal 7 to favor usability. It offers, quick links to pages performing administrative operations. By default it is available for core block and node teaser view. But designed to be made extendable for other items too - Views, panels, and so.
 
Custom contextual link (aka ccl) module is the best choice for adding custom link items.
 
But I have faced some problems in ccl module while adding a custom contextual link for a block.
knackforge blog knowledge base

Joyride tour in older versions of jQuery

Joyride, the nice guide/tour library based on jQuery, does not work in older version of jQuery (like 1.3 or 1.4). We had a Drupal 6 project, where we wanted it. Our Drupal 6 site used jQuery 1.3 version.  We tweaked the joyride code to make it work in jQuery 1.3. Basically,1. We included a function that is not a part of 1.3 version (isEmptyObject) 2. Older versions of jquery seems to differ in the way constructor context are being utlized. Hence we had to find the correct next li item using a bit of code,

    sql dump and sync

    Drush sql-dump and sql-sync - skip specific tables

    At KnackForge we use Drush more often as a part of Drupal development projects. As Drupal developers, we frequently feel the need for getting the most recent database dump from live site. When I did this recently, it was relatively a big site, thought it would be nice to skip a few tables that are not essential. At least to avoid unnecessary time spent on I/O operations. This is one of the few things that I have least tried with Drush.

    How we managed to send 75k emails per hour

    Ardent team at KnackForge always love to get hands dirty with challenging projects. In this connection we recently took an interesting newsletter sending project from one of our potential clients who is doing relatively big in Internet marketing.

    In brief, we were asked for a custom system for sending out newsletter emails, based on Drupal. Tentatively 600k emails to be sent per month. A newsletter list shall have up to 80k users and limited to a couple of lists to begin with.

    drupal themeing

    Leveraging CKeditor template to theme Drupal contents

    WYSIWYG (a.k.a HTML Editor) has become a De facto for quickly formatting and publishing contents from dynamic site like Drupal. This is certainly a time saver and prevents from getting hands dirty with HTML.

    In this connection, CKEditor has been a pioneer and around in use and development cycle for a decade (first release was on March 2003, in the name FCKeditor).

    url shortner

    Replacing lengthy URLs in simplenews newsletter email with Bit.ly short URLs

    Simplenews, a newsletter module allows you to send customized confirmation emails on subscribe and unsubscribe actions. The default singe email confirmation for subscribe looks as below,

    Subject:

    Confirmation for [simplenews-category:name] from [site:name]

    Body:

    We have received a request to subscribe [simplenews-subscriber:mail] to the [simplenews-category:name] newsletter. To confirm please use the link below.

    [simplenews-subscriber:subscribe-url]

    Subscribe to Drupal planet