Hi,
It seems module.config is problem
You can change as following:
<?xml version="1.0" encoding="utf-8" ?>
<module clientResourceRelativePath="~/ClientResources">
<dojo>
<paths>
<add name="Epik" path="Scripts" />
</paths>
</dojo>
<clientResources>
<add name="epi-cms.widgets.base" path="Scripts/Editors/DateTextBoxUtc/Template.html" />
<add name="epi-cms.widgets.base" path="Scripts/Editors/DateTextBoxUtc/DateTextBoxUtc.js" resourceType="Script" />
</clientResources>
<clientModule>
<moduleDependencies>
<add dependency="Shell" type="RunAfter" />
<add dependency="CMS" type="RunAfter" />
</moduleDependencies>
</clientModule>
</module>
OR
<?xml version="1.0" encoding="utf-8" ?>
<module>
<dojo>
<paths>
<add name="Epik" path="ClientResources/Scripts" />
</paths>
</dojo>
<clientResources>
<add name="epi-cms.widgets.base" path="ClientResources/Scripts/Editors/DateTextBoxUtc/Template.html" />
<add name="epi-cms.widgets.base" path="ClientResources/Scripts/Editors/DateTextBoxUtc/DateTextBoxUtc.js" resourceType="Script" />
</clientResources>
<clientModule>
<moduleDependencies>
<add dependency="Shell" type="RunAfter" />
<add dependency="CMS" type="RunAfter" />
</moduleDependencies>
</clientModule>
</module>
I've tried both of these module.config changes and it still has the same issue.
Do i need to specify a resourceType for the template?
It is weird. I mistypo in sencond one and updated it. But I think you do not need to add any thing to <clientResources> section if you use this js file in Editor Descriptor and set client class to this js file already.
Just need to add something as you did if you want to always load your resources whenever loading epi base resources.
The resource should be script or style, the template file is loaded when js file is loaded.
So the template.html shouldn't be listed in <ClientResources> section? I've removed this but still seeing the same errors. I saw the typo, still not working.
Yes, the template.html should not be listed in ClientResources section. It is so weird. Do you stop debugging and re-run again after changing module.config file?
Yes, i stopped debugging and re-run after making the config change. Still no change.
I've found the solution. The template doesn't need to be referenced in the module.config file, and the reference to it in the js file needs to have the path from the webroot rather than a "./" relative path.
i.e. 'dojo/text!/clientresources/scripts/editors/datetextboxutc/template.html',
I have a custom dojo component with a Template.html file. It seems to be trying to load the Template file from /Episerver/Shell rather than from my component location.
Files are in wwwroot as follows:
DateTextBoxUtc.js
module.config
I'm referencing the Template.html in the js file by using "'dojo/text!./Template.html" as it is in the same folder. Is this not the correct way to be referencing the template file?