2

I need to include a link to a css file, but, the name changes. The problem is, I am working with MSCRM 2011, and I am integrating a custom pop up window, that I need to have the "CRM style"

The link looks like this:

<LINK rel=stylesheet type=text/css href="/MyOrgtest/_common/styles/fonts.css.aspx?lcid=1033&amp;ver=-900509389">

The thing is, when I do it in a test environment (organization "MyOrgTest") the css link names includes the organization.

So, I need to, somehow, dynamically change this link, with something like a wildcard... I don't know, so I do not have to change the link manually.

Is this possible???

Kimtho6
  • 6,154
  • 9
  • 40
  • 56
mRt
  • 1,223
  • 6
  • 18
  • 32

1 Answers1

3

If you open your solution (Settings > Solutions > Open your solution) and select "Web Resources" you should be able to add an html page like you have done with your css file. It will have a url just like your css file:

<Microsoft CRM URL>/WebResources/<name of Web resource>

You can then reference your css file by a relative path like:

<link rel="stylesheet" type="text/css" href="/styles/fonts.css" />

An un-necessary alternative would be to dynamically generate the url of the css via javascript, using the context to get the server url:

var context = GetGlobalContext();
var serverUrl = context.getServerUrl();
var cssPath = serverUrl + "/WebResources/styles/fonts.css";

Once you had this you could check questions like this one to add the css file via javascript.

Community
  • 1
  • 1
David Spence
  • 7,999
  • 3
  • 39
  • 63