Tuesday, December 6, 2011

Friday, December 31, 2010

Name some of the global variables in drupal?

$custom_theme;

Change active default themes

$base_path;

Tell the cuurent base path

$base_url;

Tell the site url

$db_type;

Tells active Database type

$theme_path;

Tells the current theme path

$language;

Tells the active language

$user;

List has obj of user details

These are most often used global variable in drupal.

How to upgrading from Drupal 5.x to Drupal 6.x ?

Check this link to know about it

Tuesday, December 14, 2010

How to alter an form?

hook_form_alter(&$form, &$form_state, $form_id)

put an if condition for form id & based on that write the code.

hook_form_FORM_ID_alter(&$form, &$form_state)

How to do operation on form submit,delete,update?

In any custom module file you have write an hook_nodeapi to do this "hook" is your module name

function hook_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'presave':
break;
case 'insert':
case 'update':
case 'view':
case 'delete':
}
}

What is the default storage engine for database in drupal 6 & 7?

In drupal 6 default storage engine is MyISAM
In drupal 7 default storage engine is INNODB