Sarkari Naukri and Naukri

Thursday, 4 April 2013

contributed modules drupal

Contributed modules live on Drupal.org, specifically, at http://drupal.org/project/modules. You can search the module list and filter it by category, Drupal version, and status. You can also sort based on most installed, title, author, last release date, etc.

what is modules in drupal ?

Drupal is designed to be modular. Instead of always having every possible tool or feature in every site's code, you can just have those you're actually going to use.

Drupal core —what you get when you install Drupal— is like a very basic box of Lego™: a platform and some basic bricks (modules) to get you started. You can do a lot with just those basics, but usually you'll want more.

That's where contributed modules come in. Contributed modules are packages of code that extend or enhance Drupal core to add additional (or alternate) functionality and features. These modules have been "contributed" back to the Drupal community by their authors.

Types of module drupal


A Drupal site can have three kinds of modules (the 3 Cs): 
 
Core modules that ship with Drupal and are approved by the core developers and the community. 
 
Contributed modules written by the Drupal community and shared under the same GNU Public License (GPL) as Drupal. 
 
Custom modules created by the developer of the website.

L() used in drupal


formats an internal or external URL link as an HTML anchor tag. 
 
This function correctly handles aliased paths and adds an 'active' class attribute to links that point to the current page (for theming), so all internal links output by modules should be generated by this function if possible. 
 
l($text, $path, array $options = array()) .

t function in drupal


Translates a string to the current language or to a given language. 
 
The t() function serves two purposes. First, at run-time it translates user-visible text into the appropriate language. Second, various mechanisms that figure out what text needs to be translated work off t() -- the text inside t() calls is added to the database of strings to be translated.

What is hook in drupal ?


Allow modules to interact with the Drupal core. 
Drupal’s module system is based on the concept of “hooks”. A hook is a PHP function that is named foo_bar(), where “foo” is the name of the module (whose filename is thus foo.module) and “bar” is the name of the hook. Each hook has a defined set of parameters and a specified result type.

Properties of .info file drupal

name (Required) .
description (Required) .
core (Required) .
style sheets (Optional) .
scripts (Optional) .
files (Optional) .
dependencies (Optional) .
package (Optional) .
php (Optional) .
configure (Optional) .
required (Optional) .
hidden (Optional) .