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.

What is the answer to HTML, Web 2.0 and everything?

Well it may not be 42 but this great video by Michael Wesch an Assistant Professor at Kansas State University does an excellent job of visually explaining what Web 2.0 is all about and how it differs from conventional media and the Web we all go used to prior to this Century:

Web 2.0 ... The Machine is Us/ing Us

Very nice CSS replacement for the SELECT MULITPLE tag

The title pretty much explains everything. The SELECT form tag has a MULTIPLE option but in practice this turns very ugly very quickly. This little CSS hack provides the functionality of the tag without the user-interface nightmares.

 

Book Review: The Zen of CSS Design

After suffering from an artistic drought when laying out a web page I went out and purchased The Zen of CSS Design by Dave Shea and Molly Holzschlag. The book is very attractive and filled with colour images of web pages from numerous designers from around the world. It caught my eye when browsing the rows of web design books because it did not actually look like a computer book, in fact if you dropped the acronym CSS you would not even guess it was about technical web programming.