Pages

Monday, June 18, 2012

Manual fix for broken image links via wysiwyg in drupal 6

While working on localhost, the path for wysiwyg images could be /sites/site_name/sites/default/files/img.jpg. But after uploading on to server, the image path could become /sites/all/default/files/img.jpg. To fix this path error manually, run the following query in the phpmyadmin sql.
UPDATE boxes SET body = replace( body, "/sites/site_name", "" )

Friday, June 8, 2012

Add external css stylesheet in drupal 6



<!--php
$inc_path = drupal_get_path('theme', 'your_theme_name') . '/path/name.css';
$file = realpath(".") ."/". $inc_path;
if(file_exists($file)) {
drupal_add_css($inc_path , 'theme', 'all', FALSE);
$vars['css']['all']['theme'][$inc_path] = 1; // this is what makes it work!
$vars['styles'] = drupal_get_css();
}
?-->