Sunday, July 24, 2011

drupal_add_css is not working

Drupal remove css file starts with base path. For example, if you are trying to add  css like drupal_add_css(base_path().drupal_get_path('module','your_module').'css/mystyle.css'), then base_path() function is make your css file unreadable.

To fix this remove base_path() function from drupal_add_css and you should say drupal as follows drupal_add_css(drupal_get_path('module','your_module').'css/mystyle.css'). The css path string should look like /sites/all/modules/your_module/css/mystyle.css instead of /your_project /sites/all/modules/your_module/css/mystyle.css.

Drupal 7 provide more flexible options data will allow you to change path. For more detail go to http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_add_css

Note: Please leave your queries and suggestion as comment.

Thursday, July 21, 2011

Fatal error: Call to undefined method HTML2FPDF::DisplayPreferences()

Fatal error: Call to undefined method HTML2FPDF::DisplayPreferences() in C:\External Program Files\xampp\htdocs\projectname\sites\all\modules\yourmodule\html2pdf\html2fpdf.php on line 158

This error is rising because of path problem.To resolve this error, define constant named RELATIVE_PATH as following