SaaS CMS has officially launched! Learn more now.

Using Dojo modules on a separate .aspx page



We have a product that's based on Web Forms and it can be used as a part of different CMSs or as a stand-alone system. It involves a management interface that's supposed to integrate with parts of the CMS it's being run as a part of. In EPiServer's case we run it in an iframe embedded inside a simple EPi plugin page.

In particular we need to embed the HTML editor and file picker widgets from the surrounding CMS into completely stand-alone .aspx pages. Before this worked just fine because the EPi widgets were simple ASP.NET web controls I could just load onto the page. This is done so that the content editing and file system views are consistent across the website. These pages cannot statically inherit anything EPiServer specific as they are also used with other CMSs. I can add extra things dynamically to the page however by means of an integration plugin for each supported CMS.

So what I'm currently trying to do is write lean and mean wrappers for the new Dojo widgets so I could embed those on an EPiServer-agnostic page. I've hit a wall though because I can't even figure out how to load all the requires JS and CSS files without writing everything as EPi modules to begin with. I've tried playing with IClientResourceService and RequiredClientResources controls on a separate page but they don't seem to do anything.

How do I load the entire Dojo system on a separate .aspx page? Essentially all I want to do is write a 'define()' and have it work.

Jan 15, 2014 8:09

Hi, please try this:

        <%= Page.ConfigureDojo(true, true) %>
	    <%= Page.ClientResources("Dojo") %>
	    <%= Page.ClientResources("Dijit") %> 


//Ha Bui

Edited, Jan 15, 2014 8:32

Sorry for the extremely belated reply. I finally got around to working this out - and while the Page.ClientResources methods didn't seem to do anything, ConfigureDojo put me on the correct track. Thanks habu!

After about three days of debugging and reading through minified source code I finally managed to get everything I needed running. I now have the EPi WYSIWYG editor and a media chooser dialog running on a separate page.

Judging by the amount of trickery and how little of everything is documented I get the feeling I'm really not supposed to run the modules on a separate page. But I needed to do it as what I'm working with is a module that works with multiple CMS products and only uses small parts of them - I cannot put EPi stuff around the entire page as it has to work without EPi as well. I might post an example gist or whatnot later on how to get things working if anybody else is crazy enough to try this.

Edited, Apr 11, 2014 14:52
* 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.