Customising the number of Drupal's TinyMCE buttons

I have recently upgraded the site from Drupal 5 to Drupal 6. This was no simple task given the level of API changes that occurred between releases.

Note to Drupal community: If you want to be taken seriously in the 'enterprise' world you need to be backwards compatible with third-party modules. Forcing everyone to completely rebuild their modules and sites every year is not a viable option.

Anyhow I use the TinyMCE module for writing posts but do not like the default way it takes up half the textarea window with wasted grey space (see below):

To get around this problem edit the modules/tinymce/tinymce.module file and change the line that reads:

$min_btns = 5; // Minimum number of buttons per row.

To something more sensible like:

$min_btns = 30; // Minimum number of buttons per row.

This will give you an editor that is far more space efficient and better looking:

 

Making Drupal's TinyMCE module produce domain absolute URLs

By default Drupal's excellent TinyMCE module will convert domain aboslute URLs (e.g. http://www.stress-free.co.nz/sites/default/files/u63/drupal_logo.png) into plain old absolute URLs (e.g. /files/u63/drupal_logo.png). Generally this is not a problem so long as you do not want to use an external web service such as FeedBurner for your RSS feeds. Unfortunately FeedBurner does not handle plain old absolute URLs very well. This is because the domain name for your FeedBurner enabled RSS feed is feeds.feedburner.com and any absolute (or relative) links in your post try resolving to this domain name rather than the original website.

In a perfect world FeedBurner would parse incoming RSS feeds and replace absolute/relative URLs with domain aboslute URLs to ensure everything works (or maybe it can and I haven't figured out how to do this). Fixing this problem in Drupal when you are using the TinyMCE editor is a little tricky because TinyMCE tries to be helpful by replacing your domain absolute URLs. To get around this we have to tell TinyMCE to leave these URLs alone and convert any new absolute or relative URLs into their domain absolute equivalents.

To achieve this edit the modules/tinymce/tinymce.module file in your Drupal site and change the following lines (line numbers relate to 5.x-1.x-dev release of the TinyMCE module):

Line 494 change:

$host = $base_url;

to your site's domain name:

$host = "http://www.yoursite.com/";

Between lines 505-506

$init['relative_urls'] = 'false';
$init['document_base_url'] = "$host";

add the following extra parameter:

$init['relative_urls'] = 'false';
$init['remove_script_host'] = 'false';
$init['document_base_url'] = "$host";

These settings are taken from the TinyMCE FAQ on the subject. Once you have made these changes you should find TinyMCE behaves itself much better when it comes to using FeedBurner.

Capturing workplace knowledge with Drupal

Formally recording what we have learned in the workplace is a worthwhile process that is often forgotten or not undertaken because there is no time or immediate incentive to do so. Web-based technologies such as wikis and blogs have demonstrated that enabling people to quickly publish and publicise their knowledge within their peer group is potentially a very powerful means of undertaking collaborative knowledge capture. This article explores how Drupal, an open-source content management framework can be used to facilitate this process in a community centric manner.

So much to know, so little time

A workplace such as an architecture practice generates a lot of 'on the job' knowledge which at the time can seem obvious or worthless but afterwards can be invaluable. Such knowledge can range from the most appropriate window detail to use in a certain situation, to the most efficient way of modeling that window detail in the office CAD package. Usually these little morsels of knowledge are never formally recorded because it is just more work that typically is not budgeted for, or acknowledged by, management. As a consequence finding an answer to one of the aforementioned questions becomes dependent on your ability to understand the workplace's knowledge topography (i.e. who knows what). But even though it maybe common knowledge in your workplace that Bob has a collection of decent window details or Andrew 'the CAD guy' will help you out, what happens when they are not available, or even worse quit their job to work at the more fashionable architecture practice across town?

Drupal 5.0 release & video

Drupal 5.0, an open source content management system (CMS), was released this week. To help new and existing Drupal users (like myself) understand what is so cool Lullabot has created a very nice Drupal 5.0 new features video. The short video is worth watching even if you have never used Drupal or a CMS before as it illustrates many of the new and cool looking administration features that makes Drupal arguably one of the best CMS choices around. After watching the video it looks like I have some work ahead of me this weekend in order to upgrade this site to the new release.

Easy OpenID and Drupal

OpenID is an easy to setup identification system for both users and developers that is beginning to gain industry momentum. OpenID uses URL's as unique identifiers which is a flexible and memorable way of tackling what your identity is. As it is relatively simple in principle OpenID is not a solution for all identity tasks but in a loosely joined, Web-centric context it is well suited.

All you need to do to use it is sign up for a free OpenID account, or if you are really adventurous implement your own system. When you login to an OpenID-enabled website/service it takes your submitted url and password and passes it on to the OpenID service for authentication. The first time you successfully authenticate you must tell the OpenID service exactly what (if any) information the target website/service should be able to see.

StressFree website migrated to Drupal

Drupal logo

Over the weekend I have migrated the StressFree website across to the Drupal content management system. The move was spurred on by the shortcomings I kept finding in Joomla, the desire to be able to tag content and the knowledge that the next upgrade to Joomla 1.5 would require almost starting from scratch.

I have tried my best to maintain all the legacy links so hopefully the old Joomla and static file links should resolve okay. Overall it went really smoothly, Drupal is a little bit more difficult to get your head around compared to Joomla but now that I've made the switch I am very glad. There has been limited loss of functionality in the switch but a tonne of new features are now available: