Just a quick post to share this great little gem of a module: filefield paths.

This module allows you to set a custom dynamic path using tokens for your files or images uploaded through CCK’s filefield or imagefield. Why is this great? Because it allows you to structure files on your server and avoid having thousands of files in the same folder. Without this module, you are limited to (useless) user tokens or one static upload path.

When you enable this module, you get a lot of extra node/date/content-type tokens and can easily configure an upload path like:

image-field-path-settings-drupal

Now, all images in that particular node will be available in a folder named with the unique node-id. And imagecache will also respect this path to put its derivative images. This is really recommended when you build big sites with hundreds of nodes and each node has many images.

 
Feb
16

Tips for better Drupal usability

Gepost in Drupal, Tips & Tools door Albert

improve-usability

update july 2009: be sure to look at the addendum in the comments for some updates in this list!

Usability is a hot issue in the Drupal community. It’s one of the areas where big improvements can be made and serious efforts are being taken to make this happen. Just before Drupalcon DC starts, the University of Baltimore will perform formal usability testing of Drupal 7.

Like the previous testing Baltimore did (If you haven’t already seen that video, you really should watch it), these tests and the fact that Mark Boulton will help with the UX will definitely result in Drupal 7 being the best release ever, probably released in Q4 of 2009.

Okay, but in the meanwhile we still want to make Drupal 6 sites as usable as possible. Fortunately there are a lot of quite simple things you can do to make your life (or your clients) a lot easier.

Here is a small collections of random tips and modules which – in my opinion – improve the usability. Most are backend solutions – the frontend usability is mostly improved by theming and design.

1. Users don’t understand muliple select boxes
I’m sure you know you can use ctrl+click to select multiple options in a select box, but most normal users don’t. They do understand checkboxes so why don’t use those instead?

For example Views with exposed filters tend to generate these select boxes and you can easily replace them in Drupal 5 with views_checkboxes or betterselect for D5/D6.

2. Disable stuff visitors don’t need
Basically, you should disable all distractions which the user doesn’t need. Drupal delivers a lot of functionality out-of-the-box but you should not overwhelm your visitor with it if it isn’t useful. For example, you often want to hide the node metadata like author information in your search results because they’ll just be confusing.

Another example, if you have users logging in, there are often tabs you want to remove or you may want to modify forms. You should avoid using CSS to hide elements on your page.

3. How many results?
If you use Views you will at one point probably have a page with some (search) results. The thing is – Drupal won’t automatically display the number of results (node count). It’s a small addition but can be a big help for your website visitor. There is a code snippet for Drupal 5 and 6 to add this functionality to your views results. You simply place it the header area of the view. Alternatively, you can embed the count in the views title (drupal 5).

Let's go vertical!

Let's go vertical!

4. Organize your node-edit screen
Luckely, there is one great Drupal 6 module which does this for you. Vertical tabs will make your node edit screen much less cluttered and usable and they are going into core for Drupal 7. I really would not know any reason not to use this.

5. Send users to the right place
Most of the time you will have one or more seperate admin role for administrators. Each role might have it’s own tasks and you can easily redirect users based on role to a specific page using Rules.  For example, when an admin logs in you can redirect him to /admin  instead of the default ‘my account’ page.

You can also use the core trigger module instead but you will have much more features with Rules like creating different workflows (the Rules module is actually the drupal 6 succesor to the workflow-ng module) based on different users, roles and actions. A very extensive module with a lot of possibilities.

6. What you see is what you don’t get
While markdown or textile syntax might be your input filter of choice, it’s not usable for most clients. Our favorite WYSIWYG editor is FCKeditor, but you should take some time to tune it to your needs. In my experience, the default toolbars offer either too much or too little buttons/functionality.

Most of the time we want an admin just to be able to create links, headers, and basic styles like italic and bold. Most of the time we even avoid embedding images and try to use CCK imagefields for embedding images in a node – that way you’ll have more control on the layout. Also, checkout Link to Content integration for FCK. If your site doesn’t have too much nodes, this is an excellent and easy way to create links to other nodes on your site.

fckeditor-link-node-content

Configure fckeditor.config.js and fckstyles.xml

7. What has changed?
The revision option for nodes is pretty useless without the Diff module because you won’t be able to see what differences are made. So, if you use revisions, use Diff. This one is also going into core for Drupal 7.

8. Taxonomy like it was meant to be
Taxonomy is great, but sometimes the selection methos is just too confusing. For example, your in trouble if you are using a hierarchical taxonomy and need the parent item to be also checked when a certain deeper item is checked. This is when hierarchical select steps in and automatically takes care of it (as an option). In addition it also enables selection methods through jQuery which allows for very scalable solutions. You should see it to believe it.

9. I don’t know what the question is but the answer is views
The default admin/content/node screen is not very useful. For example you can’t sort nodes by date. If you want happy editors and admins, you will want to make separate admin views, probably for specific content-types or with exposed filters tailored to the admin’s needs.

10. Build your own admin dashboard
Actually, this is something I haven’t done yet, but in some cases it might be useful to have a Wordpress like dashboard screen for your admin. Because the default administer welcome screen really doesn’t present you with any information. There are some experimental module solutions for this, but I’m thinking about Panels. Wouldn’t it be possible and useful to make an admin dashboard with just views and panels?

drupal-admin-themes111. Use an admin theme
The most popular admin theme is Rootcandy. This drupal 6 admin theme offers nice icons and menu’s based on role.

Our own alternative for Garland is called Fruity (drupal 5, drupal 6 in dev).

Do you have any other tips and tricks to improve Drupal’s usability?

 

One potential SEO issue with Drupal sites is duplicate content. Until now, if you had clean url’s and pathauto enabled, any node would be accessible through 2 different urls [1]. For example:

http://www.example.com/node/13

could be the same page as:

http://www.example.com/my-example-node

[1] actually there would also be the ‘dirty’ url version /?q=node/13

Canonical
Using the Global Redirect module solves this problem by implementing a 301 redirect on the first example. Or you could disallow /node paths in your robots.txt. But now Google, Yahoo and Microsoft have embraced a new tag: the canonical links tag.

It looks like this:

<link rel=”canonical” href=”http://www.example.com/my-example-node”/>

And should be placed in the header. The url is the preferred url for the current page. So you can place it on a page which is the same – or almost the same, small changes are acceptible – and a search engine will know this is a duplicate. Google will transfer any pagerank and other properties to the preffered page.

Global redirect patch
An unofficial patched version of the Drupal Global Redirect module was made available by Yoast yesterday. It provides an extra option where you can now choose if you want to use the 301 redirect or choose for canonical link tags.

However, the module is not perfect yet. From my experiments, the module uses the first alias you made for a node. If you make another, second alias, for a page and visit that page – you won’t see the canonical link tag.

It would be nice if you could assign which alias is the preferred url. This way, you could make another alias page which lookes a bit different (for example different sidebar blocks) withouth being penalized by search engines.

 
Feb
8

Twitter

Gepost in Sociale media, twitter door Albert

I’ve become a Twitter fan. My first tweet was in march 2007 – since then I had long periods when I hardly used Twitter at all, but in the past months I started to twitter more regularly – and I’m beginning to like it more and more.

It’s a form of microbologging (max 140 characters) and it’s addictive – but also very inspirational to follow other people with the same interests. Nowadays, I find the most interesting links, thoughts and inspiration through Twitter. It has even partly replaced my RSS feeds. I still check my feedreader, but I know the most interesting stuff will reach me faster through Twitter.

The fact you don’t actually know most people on your follow list doesn’t matter. (Twitter is not for the paranoid) In fact – that’s part of its beauty. You might also say you don’t care about irrelevant (“getting a cup of coffee”) messages from people you don’t really know.
But reading these tweets really gives you an impression of that person on a much more personal level.

Hype? or a new way of communication?
While Twitter seems to be hyping now, it is already 2 years old, and in time it has developed its own etiquette, and also cool tricks like hashtags and retweets. I’ve heard it’s becoming mainstream in the US but here in Europe only the most web-savvy type of people use it.

But where can we put Twitter in the social media landscape? Someone described tweets a something that happens between blog posts. It’s a fast, short and one-to-many type of communication.

In fact, an article on ReadWriteWeb (may 2007) already gave Twitter a prominent place in the evolution of communication (take a look at the graph). Now, 2 years later, we are witnessing how Twitter is actually starting to change the way we communicate.

Most notably Twitter is changing blogging. More and more often we see a Twitter button at the end of a blog post. This way uses can easily tweet about the post if they want to spread the word. But this also means part of comments on posts in now done in Twitter and not on your blog! Twitter will definitely change blog design in the future.

SEO issues
I’m also trying to find out how Google deals with Twitter. Do backlinks in twitter count? They are often reduced to tinyurl’s but Google can handle these redirects. The issue is with the nofollow tag which is added to every link in every tweet, which stops any linkjuice flowing to your page. This is probably a good thing, otherwise Twitter would be overwhelmed by spam.

But Twitter SEO isn’t useless. The goal is to reach as many people from your target group as possible. People don’t care about nofollow and links in tweets can generate extra traffic. (which converts)

I also did a small experiment to find out how often Twitter indexes my tweets. At time of writing, I had a total of about 700 tweets and about 100 of the most recent ones are indexed. Also it seems Google is indexing my new tweets every day. That, of course, might vary in the same way any site’s indexing interval varies.

By Googling the site with site:twitter.com we should also get a rough estimate on the number of users. Currently this results in almost 30 million pages. Almost a year ago, Techcrunch reported Twitter had 1 million users.

Easy api – cool apps
Twitter has a great api which allows for some creative apps. Some of my favorites:

If you’re looking for great Windows Mobile Twitter app, for your mobile check out PockeTwit – it works great for me!

Twitter & Drupal
Twitter is build on ruby on rails (and had its share of problems with it) but if you would really, really want to, you could build it in Drupal. (But I’ve also heard you really shouldn’t ;)

However, many people from the community are on Twitter, and there is also a Twitter group available.

Getting started
If you want more information on Twitter I would recommend this excellent and recent post from Smashing Magazine on 8 tips to become succesful with Twitter. I really enjoyed reading the comments on that post, with many users being very negative about Twitter while others describe the same positive experience I have with Twitter.