drupal
Delicious blog released
As of today the first official release of Delicious Blog is available.
Delicious Blog is a Drupal module which emulates the Delicious.com daily blog posting tool since this tool does not work for Drupal. It uses the XML feed of your bookmarks to fetch the latest bookmarks and create a new node of your choice containing the links, much like on a WordPress blog.
For me, this has always been one of the things I missed the most and on my Drupal sites. Delicious.com uses the XML-RPC protocol to send out these blog posts, but the data send out seems to be rejected by the Drupal implementation of XML-RPC. Other solutions such as the FeedAPI or SimpleFeed module can only create one node per bookmark which is also not what I wanted. So, after almost 2 years of Drupal core and custom module development I finally made my first public module contribution. Hooray for me!
Adding new files to CVS without write access
In my previous post I talked about some useful Drupal CVS aliases. During the Core patch review sprint this weekend! I noticed a problem with it: adding new files.
Normally new files are added to CVS using the command:
The problem is that this command fails without write access to the repository. Luckely there is a handy little tool called fakeadd which you can use to edit the CVS entries file and let it look like the new files have been added to the repository. The patch creation function also changes by adding the -N option.
cvs -q diff -uNRp . | grep -v "^\?" > /home/jensen/Desktop/jsomers_$1_$2.patch
}
Drupal CVS bash commands
I thought I'd share these Drupal CVS bash commands I regularly use when creating patches. You can simply copy paste them into your ~/.bash_aliases file. All commands are expected to be executed from a Drupal CVS checkout folder.
cvs -q diff -uRp . | grep -v "^\?" > /home/jensen/Desktop/jsomers_$1_$2.patch
}
drupal_update() {
chmod u+w sites/default # Make folder writeable
cvs -q update -dPC # Perform update and restore from repository
chmod u-w sites/default
find . -name '.#*' | xargs rm -f # Remove backup files
}
alias dpupdate='drupal_update'
alias dppatch='drupal_create_patch'
The dpupdate command will make the sites/default folder writable, perform an update and restore locally changed files to the latest repository version, remove the write permission from the sites/default folder and remove any backup files created by the update command.
The dppatch command will create a patch. Modify it to your needs. When calling this command I specify 2 parameters, the first is usually the issue numbers and the second one is my patch number. Hence using the command
will create a file called jsomers_1000_2.patch and place it on my Desktop.
More TinyMCE Experiments
More TinyMCE experiments. The TinyMCE Drupal module is a bit outdated and people are pushing towards the Wysiwyg API module which could be a candidate to end up in core at some point. I must say that it does provide some nice features and is a lot easier to please several people since it allows you to install multiple editors next to each other and assign an editor based upon the input filter. All it needed was a small IMCE patch and we're good to go.
On a side-note: my first patches made it into Drupal 7 core. Personal achievement of the month!
TinyMCE experiments
I was experimenting with various Drupal related plugins, mostly CCK Imagefield and ImageCache but they all seem to have some issues. So after using FCK Editor for a long time I decided to give TinyMCE and IMCE another try and it seems they made a lot of progress.
I uploaded my current desktop as an example. The wallpaper itself came from here and I found out about it here.
Acquia Marina
On one of the Drupal IRC channels somebody mentioned he had problems using themes designed for 6.x on his 6.6 installation. I decided to try one out myself and I choose the Acquia Marina theme which was originally designed for the Acquia version of Drupal. As far as I can tell everything works as expected.
Seems nice though, doesn't it?
Blogroll
I added a Blogroll to my website.
- Blogroll
- A list of blogs, usually placed in the sidebar of a blog, that reads as a list of recommendations by the blogger of other blogs.
Most blog publishing applications ship this functionality by default or provide a custom module. Unfortunately I couldn't find a suitable Drupal module to do this - the existing module is horribly out of date - so I attempted to create one using CCK, Link and Views. CCK and Views are relatively new to me but I start to understand why they are so powerful and why people love these modules so much.
The only thing I will do in the near feature is to create a page containing all the links with a small description of the website and limit the number of items in my Blogroll block so it doesn't grow out of proportion.
Drupal Upgrade
It came to my attention that my hosting provider seemed to have upgraded the database server this website is using which finally allowed me to upgrade my Drupal installation to version 6.5 which has been released earlier today due to some security issues. More information about those issues can be found in the report SA-2008-060 for those who care.
So far the upgrade seemed to have gone smoothly and no side-effects occur.
Fancy jQuery table coloring
I've never been a great JavaScript wizard or user even, but recently I've began to use jQuery. jQuery is a lightweight JavaScript library that emphasizes interaction between JavaScript and HTML. jQuery is the JavaScript framework used by Drupal, hence my connection to it.
I must say, I'm quite impressed by the power JavaScript has. I never knew it had so many possibilities. Things I used to write complex PHP snippets for can be simply done using JavaScript which is great for static HTML websites.
For example, let's say you have a table and you want to change the background color for odd table rows. You could change the background color for each row, but if you want to change the color later on you need to replace quite a few elements. Using Find-And-Replace-All might be a solution, but let's forget about that for now. The best solution is to add a class. But what if the person adding new elements doesn't know HTML and you don't want to bother them with adding classes to the correct table row.
Assume the table has a class called sortable and you have a class in your CSS file called odd.
$('table:sortable tbody tr:odd').addClass('odd');
});
That's it. All there is to it. It will add the class odd to the odd table row elements. Counting is done by the build in JavaScript element counter.
Understanding Drupal
I finally came around to view the Understanding Drupal DVD I bought from Lullabot.
Extract from the web page:
The DVD provides an overview of Drupal as a content management system, as a PHP web application framework, and as a developer community. Its documentary-style exploration covers all the terminology and fundamental concepts for both site administrators and developers. If you’ve ever been confused by Drupal or are still trying to wrap your head around the community and platform, then this video is a roadmap to accelerate your journey up the Drupal learning curve. Topics include:
- How content is entered and managed
- How users and user permissions are handled
- What blocks are and what they can do
- The concepts and capabilities of Drupal’s powerful module system
- How Drupal handles navigation and its menu system
- How themes alter the site layout, design, and presentation
- Site configuration and administrative messages and settings
I have been working with Drupal intensivly for quite some time now so I start getting to know all the tricks and terms but for someone who's new to Drupal this is a must see video which explains it far better than any tutorial or handbook page I've read so far.

