Skip to content

Instantly share code, notes, and snippets.

@Oblongmana
Oblongmana / *Custom_Page_Message_Framework.md
Last active March 12, 2020 01:42
#Custom #pageMessage #framework - mostly aimed for use in #portal contexts where it's important to be able to control the #style applied to messages. This framework uses #bootstrap classes for styling (so of course, you're probably going to want to use it with bootstrap!)

Custom Page Message Framework

This framework gives you a way to exert control over style when providing confirm/info/error/warn messages to your users in Visualforce pages, because let's face it: the default styles are not that pretty/easy to bring into line with a Client's style, particularly when being used in a Portal (I haven't personally worked on any clients using Communities yet, so can't comment on the aesthetics there!).

This framework is pretty simple and self-contained, including 100% test coverage for each class. The only things you need to bring to the party are Bootstrap css and js, and some very minor alterations to your controller and page files, which can be easily done with a quick find/replace or two.

Dependencies

Bootstrap css file : Optional, but strongly recommended unless you need to roll your own style
Bootstrap js file : Optional, but required if you want your messages to be dismissable