Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...How to add javascript to <head> tag in skin or at Site levelHow to add javascript to <head> tag in skin or at Site level
Previous
 
Next
New Post
4/5/2017 10:54 PM
 

Hi, is there a way to globally add javascript (inside <script> tag) into the <head> section of all pages on a site. Can this be done on the skin , or through Site settings?

Thanks

Tom

 
New Post
4/5/2017 11:16 PM
 

Yes. In the skin. Here's an example using DNN's Client Resource Management:

<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %>

<dnn:DnnJsInclude runat="server" FilePath="js/html5shiv.js" PathNameAlias="SkinPath" ForceProvider="DnnPageHeaderProvider" />


Rich Campbell
Engage : Your ideas, Our know-how
DNN Experts
St. Louis, MO
314.966.4000
 
New Post
4/6/2017 1:29 PM
 
Tom,

you can also use Will Strohl's Content Injection module to get that: https://wnsinj.codeplex.com/

I must say, I never got this to work when using the "Javascript/CSS" option. Better use the HTML option and place script-tags around the script. Select "Top of page" at the end and you're done.

Happy DNNing!
Michael

Michael Tobisch
DNN★MVP
helferlein.com - Michael Tobisch's Site about DNN, SQL Server, ASP.Net and other related stuff dnn-Connect.org - The most vibrant community around the DNN-platform
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...How to add javascript to <head> tag in skin or at Site levelHow to add javascript to <head> tag in skin or at Site level


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out