Flipkart

Tuesday, September 6, 2011

Get Drupal Logo Path

Below is the code to get the Active site logo path in Drupal:

$logo = theme_get_setting('logo');

Thursday, July 21, 2011

Add Input Format to Textarea in Custom Module

To apply input formats to any textarea in our custom module forms we can use below code:

$form['format'] = filter_form(FILTER_FORMAT_DEFAULT);

example:
$form['body'] = array(
    '#type' => 'textarea',
    '#title' => t('Body'),
    '#default_value' => 'sample',
  );
$form['format'] = filter_form(FILTER_FORMAT_DEFAULT);


If you are creating Textarea under Fieldset then we have to apply filedset name to that format element as array like:

$form['filedset']['format'] = filter_form(FILTER_FORMAT_DEFAULT);

Tuesday, July 12, 2011

Wednesday, June 22, 2011

Drupal Module List

Here is the link where you can find all the module list based on the usage per week.

http://drupal.org/project/usage


Below you can find the video which explains the usage of the each module in real time.

http://gotdrupal.com/videos/top-drupal-modules


Monday, June 20, 2011

Reset admin(uid = 1) password in drupal 7

When the password for the user to Drupal (the administrator) is lost and the e-mail notification does not work, you can set the password via an SQL query.

But you must first generate a password hash that apply to your site.

Run the following commands from the command line, in the Drupal root directory:
For Linux:
./scripts/password-hash.sh newpassword

For Windows:
php .\scripts\password-hash.sh newpassword 

Then it will generate the Hash Password which somethink like
$S$CTo9G7Lx28rzCfpn4WB2hUlknDKv6QTqHaf82WHTsTHiod

Then execute the following query on the Drupal database:
UPDATE users SET pass ='thepasswordhash' WHERE uid = 1; 

OR you can use below code to get the Password:

require_once 'includes/password.inc';
echo user_hash_password('newpassword'); 
die();

Add above lines in index.php below this
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);


And refresh it .

Friday, June 17, 2011

Downloaded modules not showing up Drupal

There are mant reasons to not displaying downloaded modules in admin->site_build->modules. I f you face similar issue then please check below methods to resolve it

Run Cron Manually
Apply Permission to 755 to modules folder
Check whether same module is existing with other name(Check file names in side the module folder)
safe_mode should be OFF(check in phpinfo())