Showing posts with label Drupal 7. Show all posts
Showing posts with label Drupal 7. Show all posts

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.
    ALL DOCS MUST BE WRITTEN IN GRAMATICALLY CORRECT AND PUNCTUATED SENTENCES.


  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! 

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!



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

Search This Blog

Chennai Drupal Community

drupal.org - Community plumbing

Shyamala's Drupal SEO