Include Javascript file for all pages on the website

Topics: Customizing Orchard
Aug 29, 2014 at 7:14 PM
I need to include a custom javascript file in all pages of the website, is this possible? It looks like you should be able to do this through the Layout.cshtml view in the theme but I would like this to be a stand alone module that can be turned on and off whenever the user requires this specific javascript to run. Thank you.
Aug 29, 2014 at 11:46 PM
You can implement a class that derives from FilterProvider and implement IActionFilter for that. Inject an IResourceManager, and invoke its Include or Require method to register the script you want included.
Aug 30, 2014 at 12:00 AM
Thank you sfmskywalker for all of your help thusfar. I have added a comment to my original post regarding speed bumps and would appreciate it if you could give it a look when you get a chance. Thank you.