Skip to content Skip to sidebar Skip to footer

Calling Script.require In Shape View Returned From Iresultfilter Not Working In Orchard Cms?

I'm currently writing my own module that needs some scripts to be loaded on all pages, both on the front-end and the dashboard, where the user is authorized to edit content. I've w

Solution 1:

I'm not sure why that isn't working in your view, but you could just use the resource manager to add those scripts from your filter:

_resourceManager.Require("script", "OrchardTinyMce").AtFoot();

Inject the resource manager as per usual:

privatereadonly IResourceManager _resourceManager;
publicMyFilter(IResourceManager resourceManager) {
  _resourceManager = resourceManager;
}

Solution 2:

I've worked out how to do this. I've just injected IResourceManager into my HtmlFilter and then added the scripts as follows:

_resourceManager.Require("OrchardTinyMce");
_resourceManager.Require("jQueryColorBox");

Solution 3:

If you want that other user or you can simple override this scripts (use lightBox insted colorBox). You can add your shape to Content Zone (but this shape shouldn't have output html).

Services.WorkContext.Layout.Content.Add(YourShape, ":after");

It works from IResultsFilter

Post a Comment for "Calling Script.require In Shape View Returned From Iresultfilter Not Working In Orchard Cms?"