It's possible to generate a "flash" error message at the top of the control panel like this:

craft()->userSession->setError('Your custom plugin error message.');

The message appears at the top of the control panel when the page loads, but then fades away after a few seconds. Is there any way to "pin" the message to the top of the page, so it stays indefinitely?


I have not tried but you could probably use the CP Custom JavaScript plugin to force display of .notification.error as the flash only sets display: none; and does not remove the element.

  • That's a great idea, thanks Shane! I'll give that a whirl and let you know how it works out.
    – Lindsey D
    Aug 19 '14 at 22:15

Not currently. The CP’s Javascript will automatically hide all flash messages 2 or 4 seconds after page load (4 if it’s an error).

  • Fair enough, thanks Brandon. Maybe I'll submit it as an official feature request. ;)
    – Lindsey D
    Aug 19 '14 at 22:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.