drupal5

Spice up your Drupal 5 site search field with a bit of jQuery

Notice the search field here on xdeb.org? If you have JavaScript turned on you get the enhanced version with a nice placeholder/hint that disappears when you click in the field. The search button is hidden also, I assume everyone just hit return to to the search anyway so it just take up space.

If you use Safari, or any other Webkit browser, the search field is even more enhanced. Here how it looks for you who don’t use a Webkit browser.

Safari search field example

Aside from looking gorgeous, it adds value in terms of an enhanced user-experience. It works just like any other search field on Mac OS X. If you just want the nice Safari search field, take a look at http://drupal.org/project/safarisearch.

All this is done with JavaScript on the original Drupal search form ensuring graceful degradation. If you turn of JavaScript all that happens is that you get the standard search field and button.

Here follows the code I use to implement this here on xdeb.org.

A simple related content block based on terms

I recently put up a related content block on this site and here is how I did it.

There are a number of modules, at least four, for this but a simple block PHP snippet suited me best.

This PHP snippet makes sure we are viewing a node. Gets the terms for that node. Search for other nodes with the same terms and displays the five latest it can find as a node title list.

Display a more visibel "Read more" link with Drupal

Drupals “Read more” link is by default displayed together with other links like “Add new comment” at the bottom of the teaser display. Readers not used to blogs and other moderns web sites can easily miss that there is more to read.

Luckily Drupals hook_nodeapi makes its easy to add content to the node display.

Syndicate content