Drupal

Change TinyMCE background colour in drupal from grey to white

Submitted by charles on
Found that by default the background colour for tinymce textareas was grey with my newest drupal 5 installation. Found this node which shows which style to add to your stylesheet to change the background colour to white. Add the following to your theme's style.css: body.mceContentBody { background: #fff; color: #000; }

Funny, strange, weird borders in drupal template (in firefox and not ie)?

Submitted by charles on
Took me forever to figure out that this was due to a tbody style in system.css. This border only showed up in firefox and not in internet explorer. The system style is: tbody { border-top: 1px solid #ccc;} I added this to my theme stylesheet: tbody { border: none;} Not sure if I'm missing something here, but this worked for me.

How to get the path to your theme in your drupal template

Submitted by charles on
Instead of hard coding your theme path into your drupal theme templates, it's better to use some built in drupal functions or template variables:
  • Use the $directory variable which will be available in your .tpl.php files
  • Use the path_to_theme() function - this provides the same output as the $directory variable
  • Use the base_path() function which will give you the url to the root of your site.
I always use absolute references, for example:

Drupal node insert error related to the sequences table

Submitted by charles on

I recently added a lot of data to a drupal site by running some scripts that I'd created in php. This was to save me the time of manually capturing the content. After successfully adding the content, when I tried to add a new content item, I got the following error: Warning: Duplicate entry '503-503' for key 1 query: INSERT INTO node (nid, vid, title, type, uid, status, created, changed, comment, promote, moderate, sticky) VALUES (503, 503, 'World Bank ', 'content_organisation', 1, 1, 1171017191, 1171017191, 2, 1, 0, 0) in It turns out that Drupal uses the sequences table to keep track of what the highest id in certain tables is. I had forgotten to update this table with the id of the most recent node that I'd added.