In this recipe we will be focusing on using jQuery UI to alter the page CSS definition. I sometimes see requests for branding or customizing the color scheme of Dynamics CRM. By default this is not a supported customization. Using the jQuery library we can do some nice things with the standard look of CRM.
For this recipe you can either use one of the existing solutions you have previously created, or create a new one. Make sure you have at least the system customizer permission.
Follow these steps to add your own contact icon to the Contact form:
crm_mylogo
.crm_logoswap
.function LogoSwap() { var _css = "/WebResources/crm_jqueryuicss"; var cssref = document.createElement("link"); cssref.setAttribute("rel", "stylesheet"); cssref.setAttribute("type", "text/css"); cssref.setAttribute("href", _css); $("head").append(cssref); var _csscustom = "/WebResources/crm_logoswapcss"; var _cssrefcustom = document.createElement("link"); _cssrefcustom.setAttribute("rel", "stylesheet"); _cssrefcustom.setAttribute("type", "text/css"); _cssrefcustom.setAttribute("href", _csscustom); $("head").append(_cssrefcustom); $("#ico_fhe_2").switchClass("ms-crm-ImageStrip-ico_fhe_2", "my-crm-ImageStrip-ico_fhe_2" ); }
crm_logoswapcss
..my-crm-ImageStrip-ico_fhe_2 { width: 32px; height: 32px; overflow: hidden; background-image: url("/WebResources/crm_mylogo"); background-repeat: no-repeat; background-position-x: 0px; background-position-y: 0px; background-color: #FF0000; }
OnLoad
event of the Contact form.In this example, we take advantage of jQuery UI to swap a CRM CSS class with our own custom class. We need to add to our solution three elements:
3.149.240.75