Drupal 7

By ldmqmUhAQvn2dL…, 17 December, 2013

After months of deliberation and procrastination, I have finally found the time to upgrade my own website. It's now running on Drupal 7. I decided to change the theme and keep it simple. A neat layout and also mobile friendly theme is what I was aiming for. Thanks to the many contributors at Drupal, finding a user contributed simple and clean theme was not very hard at all. The hardest part of this upgrade was the XML Sitemap module.

By ldmqmUhAQvn2dL…, 14 November, 2012

This is a small tidbit of information in the event that you wanted to alter the Drupal search results page. You can add a custom CSS class to the last search result item (for whatever reason you may have). In my case, I wanted to remove the border-bottom from the last result, so I had to add a special CSS class to do this.

Just follow these simple steps:

  1. Override template_preprocess_search_results
By ldmqmUhAQvn2dL…, 15 October, 2012

This is a small Drupal 7 tip if you wanted to create a custom node view and force a node template to use this custom node view.

Use case

Let's say you are creating a custom node template for a node of type "grades". You may need to show/hide specific fields in your content type for your Grades template. (This is just an example but you can use this tip in various ways).

The Steps

    You can create a new view mode by putting this code into your custom module:

  1. /**
    * Implements hook_entity_info_alter().
    */
    function MYMODULE_entity_info_alter(&$entity_info) {
    $entity_info['node']['view modes']['custom_teaser'] = array(
    'label' => t('Your Custom Teaser'),
    'custom settings' => TRUE,
    );
    }