Monday, April 30, 2012

Visually Differentiate Dynamics CRM 2011 Environments (alternate)

I am a big fan of this hack to visually differentiate CRM environments and have been using it religiously in all CRM environments I have worked on.
I have since found an implementation of for CRM 2011 here. Although it served its purpose, I was not quite comfortable with changing the ribbon styles as it could be a annoyance when designing/implementing ribbon icons. So here is my take on it:
There are 2 files that require modification; main.css.aspx and theme.css.aspx (The theme.css.aspx file only needs to be modified if you want this to work with read-only forms). You can find them both under %programfiles%\Microsoft Dynamics CRM\CRMWeb\_common\styles folder.

main.css.aspx

div.ms-crm-TopBarContainerGlobal
{
/* background-repeat: no-repeat;
background-color: #ffffff; */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ff00', endColorstr='#0100ff',GradientType=1 ); /* IE6-9 */
}

div.ms-crm-TopBarContainerForm
{
/* background-repeat : repeat-x; */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ff00', endColorstr='#0100ff',GradientType=1 ); /* IE6-9 */
}

themes.css.aspx
div.ms-crm-ToolBar
{
<%--<% = this.GetStyleCss(CrmTheme.Current.Form.ToolBar) %>--%>
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ff00', endColorstr='#0100ff',GradientType=1 ); /* IE6-9 */
}

The gradients were generated using CSS gradient editor.

IIS Reset for the changes to take effect.


An here is the end result:
image

image

As this is an un-supported change, you would not be able to implement this in a CRM Online environment. Here is an alternate solution that works well with CRM Online.

No comments: