Drupal 7

Implementing Nginx PageSpeed module's Shard domains with Drupal site

The web browsers by default limits number of concurrent connections for each host. When that limit exceeds, the resources (like CSS, images, etc.) will remain in queue waiting to be downloaded until the prior downloads are completed. This results slow page load times user experience. One solution to reduce page load time is by domain sharding. This technique splits the resources download across multiple sub-domains (eg. static1.webfoobar.com, static2.webfoobar.com) resulting an increase in simultaneous connections.

Twitter Bootstrap 3 navbar collapse button not working in Drupal Panolopoly site fix

As of this writing Drupal Panolopoly (version 7.x-1.30) recommended jQuery version is 1.7. Changing to its higher version, you will encounter some strange behavior in javascript enhanced widgets and menus on your site (still a limitation of Drupal Panolopoly is at most jQuery version is 1.7). However, the Twitter Bootstrap 3 minimum jQuery version is 1.9.0. Having the jQuery version set to 1.7, the only strange behavior I have encountered so far in Bootstrap theme is the navbar collapse button which it is not working.

How to disable Smart Paging's pagination for a specific node Article if automatic page break by word/characters is on

Smart Paging is very useful module to automatically split up long Drupal content into sub-pages by number of characters or words. What if we don't need the Smart Paging's pagination on a specific node content? The following are the steps on how to disable Smart Paging's pagination for a node Article:

How to setup Memcache on CentOS 7 for Drupal site

One way to optimize the authenticated users experience in Drupal site is to use Memcache. It works between the database and Drupal. Typically the queries are cached in the database but with Memcache the queries sent from Drupal to database are intercepted by Memcache and it serves them from RAM and this avoid hits to the disk or database. We see often that half of the queries are served by Memcache and we are looking significant improvement in authenticated users hits.

Methods to disable Nginx cache when user is authenticated in Drupal

There are some cases we only need Nginx cache enabled for anonymous users. I can show two ways on how to disable Nginx cache when user is authenticated and enable it for anonymous users in Drupal.

Method 1: Using Cookie

This method invloves Drupal custom module to set an identifier in Cookie that a user is authenticated.

The custom module uses hook_user_login() to set "nocache=1" in Cookie if user is logged in and hook_user_logout() to set "nocache=0" if user is logged out. The codes are as follows (you can download the custom module below this article):

Adding autocomplete to custom Drupal form using Search API autocomplete module's API

The Search API autocomplete module works well on views page with exposed filter form but we know that views exposed filter form generates less clean URL for its filtered page. Using views contextual filter is the quick way to solve clean URL issue but it requires to develop your own custom search form to pass the query to this views contextual filter. This article will show how to add autocomplete feature to custom Drupal form where data shown in dropdown suggestions are pulled from Search API index using Search API autocomplete module's API.

Drupal Search API Solr spellcheck setup for foreign language

The task is to setup the spellcheck feature of Solr in Drupal for foreign language (in this article I will demonstrate enabling German language and adding new language - Filipino). The Solr spellcheck is a feature where it gives list of suggestions if there is no search result due to spelling error.