Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DotNetNuke include javascript on every page

I want to create a module that basically includes javascript on to every page on a dotnetnuke site. I can include a js file in the current page,

ClientResourceManager.RegisterScript(this.Page, 
"~/DesktopModules/AuthenticationServices/ZapperScanToLogin/view.js", 
FileOrder.Js.jQuery); 

but what I really want to do is install my module on the home page and it will include javascript on to every page on the dnn site. Is this possible, how can I do it?

like image 729
Linton Caldecott Avatar asked Feb 02 '26 09:02

Linton Caldecott


1 Answers

I would honestly do this with a modification to your skin, but here are the steps to do it with a module.

  1. Create a module (I recommend starting with my templates http://christoctemplate.codeplex.com)
  2. Add your JS code
  3. Add the module to the homepage
  4. Go to the module settings, choose Display on All Pages
like image 186
Chris Hammond Avatar answered Feb 04 '26 22:02

Chris Hammond