A bookmarklet to hide the Drupal 7 administration toolbar
- 11 May, 2012
- 1 comments
But there are times when it's really inconvenient – like when you I want to show an unpublished page the way an ordinary mortal will see it when they visit. There's a shortcut bar underneath it, which you can hide or show at will... but that toolbar stays there, come hell or high water, as long as you're logged in.
Short of installing a module (which would be rude of me, if I'm not the guy actually developing the site), I've resorted to hiding the toolbar by manually editing the CSS properties in my browser. A little "display:none" here, a sprinkle of "padding-top:0px" there, and we're in business.
body's CSS "padding-top" value is zero throughout):
It works by hiding the contents of the toolbar, and resetting the
body's padding-top value to zero.
Of course, you might want the toolbar back again. So:
- It only disables the toolbar until you reload the page or navigate to another one.
- I haven't tested it in anything except the Mac versions of Safari 5.1.5, Firefox 11 and Chrome 19.0.1084.46. Oh, and I've tested it on all of one Drupal site.
- It assumes the
body's padding-top CSS value is zero pixels.
Let me know if it works for you – or if you've found a more useful/robust solution.