user interface

Streamlining navigation on Views pages

viewSometimes, a page generated by views can confuse a new user: The "edit" tab that one is accustomed to is missing. There isn't usually a clear connection between the view, and the "Create content" link in some faraway menu.

A simple little trick that I use to overcome this is to add a header to my views:

<?php
if (user_access('create newsletter content')) {
  print "<h3>" . l('Add a newsletter to this page', 'node/add/newsletter') . "</h3>";
}
?>

The call to user_access() makes sure that the link is only present for those with permission. Of course, you'll need to substitute the name of your content type for "newsletter". Also, this makes the most sense when the view is listing a single content type (which I find is quite often the case).

Similarly, it's not always intuitive that to edit an existing node, the user first needs to click the title to navigate to the node before the edit tab will appear.

Again, a small change can make this a lot easier on users. In Views 2, there is an "Edit link" field, which is available if you're using fields as your row style.

Tagged as: Drupal, user interface

Creating a block for a contributed module

I was recently working with the Forward module. It's a pretty cool module that adds a link to "email this page to a friend".

Instead of a link, though, the client's design called for this feature to be in a block. With a few simple hooks, the form can be rendered somewhere else, and Drupal's form API handles the details. This example deals with the Forward module, but the same technique works in many situations.

Tagged as: Drupal, email, user interface

Syndicate content