Our monthly Virtual Happy Hour is happening this week, Fri Feb 23!

Try our conversational search powered by Generative AI!

Custom EPiServer GUI dojo widget / referencing external libraries and stylesheets




I'm trying to create a custom dojo widget that snaps in to the AssetsPanel, this works fine. My problem is that I would like to reference an external js file that exists on a remote server ex:

On a standard web site I would just add a <script> tag in <head> to get access to it. But how would I go about doing this so that the widget get accesss to the script file when it is inside the EPiServer GUI?


I would also like to reference some external styelsheets in the same fashion.


Thanks in advance!




Feb 15, 2013 14:33

Try to define client resources that you need to plug-in in your module manifest (module.config file). Your module.config probably contains assembly name of your module and dojo module configuration.

Define your external resources in clientResources section and reference them in clientModule/requiredResources section. Something like this:

<?xml version="1.0" encoding="utf-8" ?>
<module loadLocalBin="false">

<!--...omitted configuration...-->
    <add name="your.module.script" path="" resourceType="Script" />
    <add name="your.module.styles" path="" resourceType="Style" />
	<add name="your.module.styles" path="" resourceType="Style" />

<!--...omitted dojo module configuration...-->
      <add name="your.module.script" />
	  <add name="your.module.styles" />


Edited, Feb 15, 2013 15:16

For more details please see this section in EPiServer Framework SDK that describes module.config settings.

Feb 15, 2013 15:21



Thank you Dmytro!

Feb 15, 2013 15:27
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.