Sunday, March 6, 2011

Interesting Facts on Drupal Module Development

I am reading Drupal 7 Module Development by
Matt Butcher, Greg Dunlap, Matt Farnia, Larry Garfield, Ken Rickard and Jon Albin Wilkins.

Inspired by the book, some Interesting Facts on Drupal Module Development that I wanted to share

  1. What is the hook implementation in Drupal?
    EVENT Triggers in drupal: The Hook implementation is a function that follows a certain naming pattern in order to indicatie to Drupal that it should be used as a callback for a particular event in the Drupal System.

    In most cases ensure the hook implementations reside within the main .module file.

  1. Placing your Custom modules:
    OPTION1: The convention that we follow is to place both Contributed and Custom modules under sites/all/modules directory. All the custom modules are placed with in sites/all/modules/custom.

OPTION2: The second approach could be to have all Contributed modules under
sites/all/modules/contrib and any Custom modules under sites/all/modules/custom. This may not be a good solution as in Drupal 7 when you use Drush, the modules are automatically installed under sites/all/modules.

OPTION3: The approach I read in the book seems really neat. Place all Contrib modules under sites/all/modules and all custom modules under sites/default/modules.
The main advantage being, it brings a clear separation between the modules maintained by us and those by the community.

But in the case of a multisite installation where there is a need to share the custom modules across installations choose OPTION1

  1. The .info file in any module always starts with a $Id$. Have you wondered why?
    This is a placeholder for the Version control system to store information about the file. ( When the file was last checked in and by who)
    With the new GIT integration alive, this should be on the way out.

  2. Follow Doxygen-style commenting (/**  */)
    @file decorator for doc-block should be the first doc block of any module
    Syntax: Begin with a single sentence Description of the module, followed by  a blank line and then followed by a one or more paragraph description of the module.

  3. $variable = ‘This is a string’ ;
    t($variable) ;

    Why wouldn’t translation system work above?

    Automated Translation run, the code doesnot execute it only simply reads.

  4. Once a module is installed, Drupal caches the content of the .info file. Revisit the module page to force Durpal to refresh this information.

  5. Drupal arrays - terminate large multiline arrays with a comma: This is to help in avoiding syntax errors while adding or removing from a large array.
    This can not be extended to drupal js arrays.

  6. 2 Most powerful Enhancements in Drupal 7

    1. PDI – PHP Data Object library integration in Durpal 7: This  library is an abstraction layer that supports numerous database layer. This provides the capability for Drupal 7 to support beyond MYsql. Postgre-sql to Oracle and
    2. Fields and Entities
                                                             i.      Field system: Bring with it CCKs functionality in the core
                                                          ii.      Entity System: make sit possible to define structures data types that are not NODES! 

Friday, March 4, 2011

Attending DrupalCon Chicago!

I have been working on Drupal projects for over 4 years now. Some high performance sites, some Durpal Applications and some others Content sites. I could talk about my Drupal experience professionally, about the features we implemented, the theming we did, the modules we developed, the performance tuning, etc. But now when I sit back now on my Flight to Newark and think about it, the most exciting part has been the Drupal Community!

When I retrospect about what I have been doing and why? What is it that has made me stick on to Drupal, work with Drupal and here fly across the world for a Drupal conference? The Answers are far beyond the challenges that I faced on a day to day basis or the bugs that I fixed in my projects or the technology I learnt. It is MUCH more than all this. It is my sense of belonging, being a part of this big community, sharing the success and the joys. The Feeling of Oneness!

In this respect I think the Drupal Community has made my experience in the last few years richer and just being a part of this one big community has given more joy.

I'm attending DrupalCon Chicago, March 7-10, 2011I do not write modules, but I love participating in the Drupal Forums. I am very active in the Forums, most of the timesJ. Over the last year I was involved in QA of the Drupal redesign and early this year in bringing us all together for the Drupal 7 celebrations. I have also been very active in bringing together the Chennai Drupal Community.

The Chennai Drupal Community has been an exciting experience. Here our interactions have gone beyond the internet. We have regular face to face meetings with each other and share our experiences and knowledge in Drupal. The energy we share is humongous. I have also got a chance to present at many big conferences in India and to conduct Drupal Introductory training programs at Colleges.

Today, I am looking forward to meeting many fellow Drupaler across the world, who I have actively followed and some of whom I have interacted with! I am excited I will be meeting them face to face… Looking forward to meeting the Drupal Community.

We must have one DrupalCon in India every year, so all my colleagues, other Drupalers in India can share this experience…  

Search This Blog

Chennai Drupal Community - Community plumbing

Shyamala's Drupal SEO