Monday, December 27, 2010

A Very Happy New Year with Drupal!

Drupal Christmas Song, Listen and enjoy the Season with Drupal!


Local Drupal Fun this NewYear:

Enjoy Drupaling this New Year. Join us at Drupal 7 Release party, Chennai. There is going to be a whole lot of Fun! Drupal Quiz, Drupal 7 Tips and Tricks, Have Answers to Questions on how you can get involved in patch writing and reviewing, Good Food and more... Be a part of Drupal in Chennai!



Friday, December 17, 2010

DrupalCon Session: Maintaining the codebase and updates of a Drupal Website

Drupal stores most of the configurations and settings in the database. Deploying and Managing a Drupal website requires both code updates as well as interface updates. Changing permissions, adding fields to your content types, modify an existing view, installing and configuring a new module are some of the typical interface updates that needs to be moved from the Development Server to the Test servers and then further in the Live servers. In this session I would like to present solutions that would facilitate the update process to be people independent and totally maintained under version control.

Want to Checkout solutions to ease the maintenance of a Drupal Website VOTE FOR my DrupalCon Session at http://chicago2011.drupal.org/sessions/maintaining-codebase-and-updates-drupal-website

Questions answered by this session would include:

How to have a Drupal update process that is people independent and totally maintained under version control? 
Question 2: 
How to use Drush to improve the Update Deployment Process for a Drupal website? 
What are Features and Strongram modules? 
How to use update.php to trigger database script updates? What are the cache flush routines that need to be called after the database updates? 
What are status of Drush, Features modules in Drupal 7?

Drupal Workshop for Academicians and Researchers at NCAR


It was indeed a unique experience presenting and conducting a Workshop on Drupal to a group of Academicians and Researchers. The Workshop was organised by Free Software Movement of India at NCAR Hyderabad, India. It gives me great pride that I participated in a Workshop that was inaugurated by Dr. A.P.J Abdul Kalam.
Siva from Drupal Hyderbad and I conducted this Workshop together. We only met in the morning, but we were so much in Synch and Conducted the workshop as though we had always worked together! Wondering what brought this togetherness, it was ofcourse the fact that both of us were Drupalers! Drupal brought us together.

Both Siva and I had short Presentations and we also helped our participants have a handson on Drupal, trying out a Drupal installation from scratch, changing the theme, enabling modules and actually feeling the power of Drupal.


My Presentation

The most exiting part of these Workshops are always the Question Answer Sessions. Some of the interesting Questions were:

How can Drupal help Academicians and Researchers?
How is Drupal different from Moodle?
How can I change the look and feel of my Drupal site?
How do you install new modules?

Thursday, November 25, 2010

Drupal's Installation Profiles

What is a Drupal installation Profile?

It is a set of Drupal modules, predefined themes, configurations bundled together into a single installation. When you install this bundled installation, all the modules in it will get installed, preconfigured and you have a ready to use Drupal website. These installation profiles could cater to specific requirements that Drupal could be used to meet, like a Newspaper website, a Wiki Website, an Intranet portal, etc. Check out Drupal Installation profiles at http://drupal.org/project/installation%2Bprofiles

Components of a Drupal Installation Profile

Install profiles are located in the 'profiles' directory of a core Drupal installation. They are named profilename.profile. A profile will contain the below set of Functions:

profilename_profile_modules() - This function defines all the modules that get installed with the profile. First the Core modules are installed, followed by Contributed, followed by Custom modules.

profilename_profile_details() - This function defines the name and a short description of the Profile. The Default profile is the Drupal profile that comes with every Drupal installation.

profilename_profile_tasks() - At this stage the modules specified in profilename_profile_modules() have been installed. And you have access to the full Drupal API so you could define any custom content types, create vocabularies and terms, change variable settings to your liking, etc

We could have database updates like:

1) Set configurations (variable_set)
2) Create predefines roles and access control
3) Create preconfigured Menus
4) Create preconfigured Blocks and CCK
5) Create preconfigured content or content types
6) Configure predefine theme

This should be followed with Cache clear and Database rebuild.

1. Rebuild menu
2. Clear Cache: run cron to clear cache or write explicit cache clear code as in the systems.module in Drupal core
DONOT use drupal_flush_all_caches(): would result in all themes being disabled
3. Based on the contributed modules enabled, we must also make sure and handle any other table that requires a rebuild following their installation.

Reference: Writing a Drupal installation Profile Handbook Page

Supporter modules:
Installation Profile API
Profile Generator

Why Create Drupal Profiles?

Drupal Profiles provide a easy maintainable suite that can be replicated for multiple users. The readily available Installation Profiles in Drupal allow a quick and easy base website.

Some Good Installation Profiles:
Drupal Commons Maintained by Acquia: This Profile provides social business software providing organizations with a complete solution for forming collaborative communities.

Open Publish: a packaged distribution of the popular open source social publishing platform, Drupal, that has been tailored to the needs of today's online publishers and Newspaper companies.

Related Links:
http://www.lullabot.com/articles/5-step-drupal-distributions
http://www.lullabot.com/podcasts/lullabot-podcast-75-drupal-distributions-and-features
http://buytaert.net/drupal-distributions
Business models around installation profiles: http://buytaert.net/on-business-models-for-drupal-distributions
Acquia partner ship programs around Drupal distributions: http://acquia.com/blog/drupal-software-publishing

Tuesday, November 23, 2010

Architecting a solution in Drupal

Architecting a solution in Drupal is not always straight forward. The main parameters that are key to a well Architected solution in Drupal are:

1. Understanding of Drupal
2. Maintainability
3. Performance
4. Working with Open source

Understanding Drupal's architecture and functionality is a key in architecting a solution in Drupal. I guess to leverage any technology a deep understanding of how the technology functions is must to use it optimally.

Main aspects of Maintainability

1. Use of well maintained modules and Plugins
2. Minimize configuration and move as much to code as possible, anything in code can be version controlled
3. Custom modules should be simplified elements, in sink with Drupals architecture
- Identifying the configuration parameters
- Use of Drupal Hooks and Drupal functionality
- Separating the Theme and the coding Layer
- Following Drupal's coding standards

The result of a well written and maintainable code should be that any Drupal programmer can pick up the module and start working with it.

Main aspects of Performance are

1. Database design:
2. Optimizing the Queries
3. Building of custom caching layer or efficient use of Drupal's Caching mechanism
4. Using appropriate technologies to make do for mysql's deficiencies - like using Apache Solr for Search
5. Server side Performance enhancements

Working with Open source

Need to be able to leverage the community to give and find solutions.
You have an opportunity to learn from the solutions used by similar interested communities and their real time experience, which could also play a role in the architecture of your solution.


A Related and interesting Blog on Evaluating Drupal Modules by my colleague: read on at http://rajeev-kottayil.blogspot.com/2010/10/evaluating-drupal-modules.html

Wednesday, August 25, 2010

Drupal 7 and it’s Extremely friendly and Intuitive Admin interface

What's in Drupal 7? Most definitely an extremely friendly and Intuitive Admin Interface!

My first impressions of Drupal 7 as Drupal Admin:

1. Extremely friendly and Intuitive Admin interface!
2. More Trendy: Extensive use of Jquery, a very interactive design
3. Navigation: Multiple Navigation points

Improved and Multiple Navigation points like:

1. Tool Bar (The Admin menu in Drupal 6)
2. Dashboard
3. Shortcuts and
4. Contextual links!
5. Admin Interface with additional TAB interface
6. Use of Overlay to display information
7. Vertical tabs in the content edit interface


Some Key Functionality in Drupal 7 core:

1. Better media handling - Image filed and Image cache is in Core
2. Custom content types in core
3. WYSIWYG Editor
4. Better Performance
5. Better tools to structure/organize content
6. Basic Views like module

Also in Core implies all these will be maintained by the Core team and be available with Drupal releases!

Reference Links:
1. Creating Drupal 7.x modules
2. Theming Drupal 6 and 7
3. Converting 6.x themes to 7.x
4. Converting 6.x modules to 7.x - Categorical
5. Menu path changes from 6.x to 7.x
6. A peek at Drupal 7 theme system changes

Thursday, February 18, 2010

Contribute to Drupal

Contributing to Drupal could be fun! It amazing the way Drupalers collaborate online to as much as have Drupal, Drupal's contib modules, and now the Drupal redesign. The power of Drupal, to promote Drupal!

Working in the community and all of your sudden your horizon seems extended, you are connected with people you have never met before. You are working together as though you knew each other for so long.

Being with people brings you joy. It's amazing to discover the joy of being with them online! I am thoroughly enjoying collaborating online for Drupal.

The different channels you can collaborate on:
IRC: Drupal in IRC and Firefox addon for IRC, Discussions online, Groups, Google groups.

Join and contribute, Check out: Drupal Redesign Implementers page

Monday, January 18, 2010

DRUPAL VIEWS - Important points and Optimization



Drupal Views is an extremely useful Query building tool! Drupal Views brings with it a great amount of flexibility to the way existing content can be displayed on a particular website.

This article highlights some important points to remember before creating a Drupal View. The concepts are explained with respect to a News paper site as example.



The Basic elements of a Drupal Views include:
  • Base Tables - Node tables, Comment tables, user tables, etc.
  • Fields - information that gets displayed
  • Filters - the criteria based on which the information is querried
  • Sort criteria - the criteria based on which the content is sorted and displayed.
  • Arguments - variable filters that can be changed dynamically when the view is constructed.
  • 'Relationship - integrating with custom tables
POINTS to remember:
  1. Reuse Views and use FILTERS as ARGUMENTS - Using Filters as Arguments lets the view display contextual content. In a Newspaper site the same view can be used multiple times for various taxonomies, taxonomy being an argument. The BLOB size of the VIEWS TABLE is very large, reducing the number of views helps in maintainability and in Performance by reducing the View table size. A couple of use cases of Arguments in Views for a Newspaper site:
    1. In the home page of a Newspaper a Single view with multiple sub channels - a single view can be used, the result obtained by passing the corresponding sub channel taxonomy can be displayed sequentially.
    2. In an Article page, the article tags can be passed as arguments to the same view to display related content based on that particular article.
  2. Typical filters to include are 
    1. NODE type == Published, 
    2. Node Article Type, 
    3. Node Created date.
  3. Always define what should happen if a view returns a 'Null value'. Typically define a message/page  it should take you to and display a specific message.
  4. While defining Arguments, define what should happen if there were no arguments passed to the view. This could be 'All values' or a Page not found, etc.
  5. UNDERSTANDING the query associated with a VIEW: In Drupal 6 you can Preview a VIEW while you are still building it. In Drupal it's so easy to construct a view and most of the time take it for granted. Below are some key points that will help you understand the View Query and give some pointers as to what to look for.
    1. Pager Query - In this case there are 2 Queries that run - one to count the total number of records and build the pager, second the Query to obtain the first set of records for that page.
      For a block/ page view with a count or limit there is only one Query.
    2. Based on the fields displayed, the filters selected and the sort criteria defined, the JOINS in the Query will be constructed. Some examples:
      1. If the filter is CCK field there will be a INNERJOIN to the corresponding CCK table



        SELECT node.nid AS nid,node.title AS node_title,
         node_data_field_article_date.field_article_date_value AS node_data_field_article_date_field_article_date_value,
         node.sticky AS node_sticky,   node_weight.sticky AS node_weight_sticky
         FROM node node 
         LEFT JOIN term_node term_node ON node.vid = term_node.vid
         LEFT JOIN content_field_article_date node_data_field_article_date ON node.vid = node_data_field_article_date.vid
         LEFT JOIN node node_weight ON node.nid = node_weight.nid
         WHERE (node.type = 'article') AND (node.status <> 0) AND (term_node.tid = 4)
         ORDER BY node_data_field_article_date_field_article_date_value DESC, node_sticky ASC, node_weight_sticky DESC



      2. For a SORT criteria as most commented the INNERJOIN to the comment stats realted table



        SELECT node.nid AS nid, node.title AS node_title,
         node_comment_statistics.comment_count AS    node_comment_statistics_comment_count
         FROM node node 
         INNER JOIN node_comment_statistics node_comment_statistics ON node.nid = node_comment_statistics.nid
         WHERE (node.type in ('article')) AND (node_comment_statistics.comment_count > 0) AND (node.status <> 0)
         ORDER BY node_comment_statistics_comment_count DESC
        



  6. OPTIMIZING the Queries:
    1. Make sure all the fields that are used for SORTING are indexed, especially if it is a custom table.
    2. If there is an explicit limit to the VIEW please define the same.
    3. If a part of the VIEW cache-able , then split the VIEW into Cache-able element that is stored in a cache table and Dynamic parts as a separate view.
    4. Use VIEWS' inbuilt time based caching mechanisms, or write custom cache code using Drupal's cache get and Cache set functions.
    5. The Query optimization is based on which tables are Large. Typically in Drupal some of the Large tables are the Node related tables, Comment related tables, Taxonomy related table, Files related tables, User related tables. This also depends on the site and it's purpose.
EXAMPLE of a slow Query - Option 2:

In the case of a large Node table - Option 1 will take less time to execute as the 'Where' clause filters the IDs in the Node table first and then filters based on the tid, which is stored in another table.

VIEW Query Option1:

SELECT node.nid AS nid,
   node.title AS node_title,
   node_data_field_article_date.field_article_date_value AS node_data_field_article_date_field_article_date_value,
   node.sticky AS node_sticky,
   node_weight.sticky AS node_weight_sticky
 FROM node node 
 LEFT JOIN term_node term_node ON node.vid = term_node.vid
 LEFT JOIN content_field_article_date node_data_field_article_date ON node.vid = node_data_field_article_date.vid
 LEFT JOIN node node_weight ON node.nid = node_weight.nid
 WHERE (node.type = 'article') AND (node.status <> 0) AND (term_node.tid = 4)
   ORDER BY node_data_field_article_date_field_article_date_value DESC, node_sticky ASC, node_weight_sticky DESC

VIEW Query Option 2:
 
SELECT node.nid AS nid,
   node.title AS node_title,
   node_data_field_article_date.field_article_date_value AS node_data_field_article_date_field_article_date_value,
   node.sticky AS node_sticky,
   node_weight.sticky AS node_weight_sticky
 FROM node node 
 LEFT JOIN term_node term_node ON node.vid = term_node.vid
 LEFT JOIN content_field_article_date node_data_field_article_date ON node.vid = node_data_field_article_date.vid
 LEFT JOIN node node_weight ON node.nid = node_weight.nid
 WHERE (term_node.tid = 4) AND (node.type = 'article') AND (node.status <> 0) 
   ORDER BY node_data_field_article_date_field_article_date_value DESC, node_sticky ASC, node_weight_sticky DESC
 

Other Resources on Views

VIEWS Handbook page: http://drupal.org/node/109604
VIEWS useful links: http://www.lullabot.com/articles/hacking-views-part-1-basic-concepts
VIEWS 2 - Building Views with Fivestar and Voting API modules: http://www.lullabot.com/videocast/building-views-fivestar-and-votingapi

Saturday, January 9, 2010

An Introduction to Drupal

An Introduction to Drupal - presented to students from engineering colleges at Free Software Foundation, Tamil Nadu meet at IFMR, Chennai. I was so excited to present Drupal to a bunch of FSF students, who where involved in presenting various Free softwares they were working on. I followed my presentation with a short Demo of installing Drupal.

Presentation path
  • History of Drupal
  • Principles of Drupal
  • Drupal’s structure
  • Key terminologies in Drupal
  • Trends in Portals – Web 2.0 & Web 3.0
  • Showcase websites in Drupal

Search This Blog

Chennai Drupal Community

drupal.org - Community plumbing

Shyamala's Drupal SEO