Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Custom Dojo widget with external resources


I am building custom widget for tag selection in CMS edit mode and would like to use custom styles and scripts, but can't get them loaded on the page.

Here is what I have.

I have this file structure:


 Then I have EditorDescriptor to load my dojo Widget for tag editing:

    [EditorDescriptorRegistration(TargetType = typeof(string), UIHint = "Tags")]
    public class TagsEditorSelectionEditorDescriptor : EditorDescriptor
        public TagsEditorSelectionEditorDescriptor()
            ClientEditingClass = "tags.TagsSelection";


function (
    TextBox) {

    return declare([TextBox], {
        postCreate: function() {


And module.config:

<?xml version="1.0" encoding="utf-8"?>
    <add assembly="Sample.Web" />

    <add name="tags-vendor" path="Tags/vendor/jquery-2.0.3.js" resourceType="Script" sortIndex="1" />
    <add name="tags-vendor" path="Tags/vendor/jquery-ui-1.10.3.js" resourceType="Script" sortIndex="2" />
    <add name="tags-styles" path="Tags/styles/jquery-ui.css" resourceType="Style" sortIndex="1" />
    <add name="tags-vendor" path="Tags/vendor/tag-it.js" resourceType="Script" sortIndex="3" />
    <add name="tags-styles" path="Tags/styles/jquery.tagit.css" resourceType="Style" sortIndex="2" />

    <add name="tags" path="Tags" />
      <add name="tags-vendor" />
      <add name="tags-styles" />

On the page type which uses tags selection I defined property with UIHint:

        public virtual string Tags { get; set; }

And I am rendering it in the view:

@Html.PropertyFor(m => m.CurrentPage.Tags)

When I open edit mode and start editing the field I see in Chrome Developer Tools Network tab that TagsSelection.js is loaded, but there are no resources which are defined in modules.config.

I found this thread in forum:

It describes that defining resources in modules.config is enought (at least as I understand).

Same also on Stack Overflow and other resources:

What I am missing?

Mar 26, 2014 21:32

Hi Maris!

Modules are currently not automatically started when you have an editor inside the module that is loaded. In EPiServer 7.5, you can define that the module should be started after another module has been started by defining a module dependency with the runAfter attribute. You can read about it here:

Mar 27, 2014 8:17

So you could add the following configuration under the clientModule section in your module config file:

<add dependency="CMS" type="RunAfter" />

Mar 27, 2014 8:18

Thanks Linus! It works - great!!!

Mar 27, 2014 9:17
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.