We're a Web Design and Drupal Development company based in Middlesbrough, UK. We specialise in easy to use Content Management Systems and E-commerce websites.

Hide Drupal Help Messages Using jQuery

23Jan2009
Picture for psynaptic

The help text of Drupal usually appears in the top part of the content area on admin pages and provides help for administrative users who may need guidance on how to use the functions available on that particular page. Once you become more experienced with Drupal you rarely need to see this information and it can get in the way of developing and administering a Drupal site.

An good example of this is the Blocks configuration page found at Administer > Site building > Blocks (admin/build/block), as seen in the screenshot below:

Of course, we could very easily remove the help altogether but that's not very user-friendly.

My solution is to use a bit of jQuery to attach a link for showing/hiding the help text. Here's a screenshot showing the help collapsed:

Clicking on the "View help" link toggles the help in and out of view.

If you know how to add a JavaScript file to your theme here's the code:

Drupal.behaviors.collapse_help = function (context) {
  $(".help").before('<a class="help-slide" href="#">View help</a>');
  $(".help").wrap('<div class="wrap"></div>');
  var height = $('.wrap').height();
  $('.wrap').hide();
  $('a.help-slide').click(function() {
    $('.wrap').css('height', height);
    $(this).next('.wrap').slideToggle('fast');
    return false;
  });
}

If you need instructions on how to add a JavaScript file to your theme, see Adding a JavaScript File to a Drupal Theme.

Posted by psynaptic

Comments

Help is in the wrong place

Picture for roy

I always move the php for printing the help to the bottom of the page in page.tpl.php.

Hopefully the new Help system will get in soon (http://drupal.org/node/299050), then we can start working on removing the help text from the admin UI, into a dedicated pop-up window. I would hope the help-link that opens this pop-up will be located *below* the main ui too.

Posted by roy
5 years 32 weeks ago

Recent Clients

Drupal Developer Reference

Screenshot of DrupalContrib API

DrupalContrib API was created by Freestyle Systems for Drupal developers who need access to reference documentation for Drupal's most popular contributed modules.

If you're a Drupal developer you'll no doubt find our resource invaluable!

Drupal Association

Drupal Association Organization member