Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

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 do I include my own .js File in my PortalHow do I include my own .js File in my Portal
Previous
 
Next
New Post
3/11/2009 11:34 AM
 

I have created a couple of customised JavaScript functions that I want to include my Portal.

 

I created a new file - RJC.js and copied this into the js folder in the root of my portal.

 

How do I make sure that this JS file is included in all pages in all of my portals?

 

I don't want to add it to one of the existing dnn js files for the fear of it being overwritten during an upgrade?

I also don't want to add it to my skin as I have many child portals that all use different skins.

I see that the dnncore.js file is registered in the Default.apsx file as follows:

            ' register DNN ClientAPI scripts
            Page.ClientScript.RegisterClientScriptInclude("dnncore", ResolveUrl("~/js/dnncore.js"))
 

This is the kind of thing I want to do, but I am reluctant to amend DNN Core code.

Is there another way of making sure my js file is included in each portal?

 


Blue & White hooped blood runs through my veins!
 
New Post
3/11/2009 3:28 PM
 

AFAIK skin is the only option, or if you want to do it nicely, a skinobject that injects the js


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
3/11/2009 5:55 PM
 

DNNStuff have a new module called InjectAnything - I have not had time to use it but it sounds like it might do what you want...


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
3/11/2009 6:09 PM
 

You could create a module that adds the reference (using the same code that the core does), and then add that module to every page.

You could use a 3rd party module that adds the reference, then add that module to every page.

You could manually or through the database update the Page Header Tags field for each page in the portal to include the correct <script> tag.  Note that this won't include new pages, unless you also create a database trigger to update each new page.

You could add the <script> tag (to the HTML view of the text editor) of a Text/HTML module and include that module on every page.

Though the easiest answer may just be to update the skins...

Hope that helps,


Brian Dukes
Engage Software
St. Louis, MO
866-907-4002
DNN partner specializing in custom, enterprise DNN development.
 
New Post
3/12/2009 5:10 AM
 

Unfortunately nearly every child portal (and there are about 200) has a different skin so I am reluctant to change each skin and I am also reluctant to add a module to each page.

I really thought this was a very simple question and I was missing the blindingly obvious answer but it seems not.

I think I will just add my function to the dnncore.js script file and make a careful note that this will need keeping a close eye on whenever we do future upgrades.

If anyone thinks this is a crazy idea and I really should not be doing this, can they please let me know ASAP please.

Thanks for the suggestions guys.


Blue & White hooped blood runs through my veins!
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...How do I include my own .js File in my PortalHow do I include my own .js File in my Portal


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