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...Skins, Themes, ...Skins, Themes, ...adding my own javascriptadding my own javascript
Previous
 
Next
New Post
11/1/2007 9:36 AM
 

please "unfind" that out. Changing default.aspx is considered a core change, and you will loose those changes when you upgrade the application to a newer version.

You can either put scripts in the skin, or in a page using the header tag option in page settings


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

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

 
New Post
11/1/2007 9:37 AM
 

if you need to load js in the onload event, i think the only good way to do that is by using a custom skin object that would do that


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

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

 
New Post
11/1/2007 10:17 AM
 

Unfortunately, this is one of the areas that DNN really fails us.  There is no built-in solution for this kind of question.  I have resorted to accepting the fact that I will always need to modify Default.aspx.vb in order to apply various business rules to my portals.  With that being said, upgrading then becomes a little bit more involved since there is a need to synchronize the two Default.aspx.vb files.

If this is a business rule for a custom installation, I would say that there is no real good reason to not integrate this kind of change into Default.aspx.vb.  However, if this is a project that is meant for distribution, then you will not want to require a Core code modification for any reason.

Just keep this in mind though.  It is very important that you keep a log of all DNN modifications.  It doesn't matter if the modifications are in the localization files, or in the default page.  You will most certainly forget about the modifications the first time you attempt to upgrade (and you want to upgrade).  Also, a good back-up strategy before upgrading wouldn't hurt either.  ;)


Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
New Post
11/2/2007 4:45 AM
 

As stated before: Do not change default.aspx!

Using ascx skinning you add a javascript link to the head like this:
(Put this in the script part of the skin)

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'add a script reference for Javascript  to the head section
            Dim oLink As New HtmlGenericControl("script")
            oLink.Attributes("language") = "javascript"
            oLink.Attributes("type") = "text/javascript"
            oLink.Attributes("src") = SkinPath & "extra.js"
            Dim oCSS As Control = Me.Page.FindControl("CSS")
            If Not oCSS is Nothing Then
                oCSS.Controls.AddAt(0, oLink)
            End if
    End Sub

You can also add the scripts at the bottom of the skin/page (which in fact is better for performance) read this

If you want to add an "onload" you can do this realiably from your JS file like this:

        //Add function to load event of page
        if (window.addEventListener){
            window.addEventListener("load", MyFunction, false);
        }
        else if (window.attachEvent){
            window.attachEvent ("onload",
MyFunction)
        }

 I think it would de good if in a future version of the skinning engine DNN would process the existing links in an HTML skin.

 
New Post
11/2/2007 8:48 AM
 

Unfortunately, your reply is not a good answer to people like me who are using DNN as part of their online business model.  I should never have to ask my design team to learn how to work with a an ASCX file.  Also, I should not require them to learn any .Net code, much less copy and paste it in order to get this done. 

Your answer goes against the very philosophy of having a skinning engine in place to begin with.  Isn't the skinning engine (i.e. DNN Skins, Master Pages, etc.) supposed to abstract programming logic from the design tier?  If not, why use tokens in the skin at all?  In fact, we might as well not even have HTML files. If your answer is the correct one, we should just forget HTML files altogether and just begin with ASCX files.

I am sorry, but we really should maintain focus on what the purpose of things are in the first place.  I agree that modifying core code components is definitely not a good idea, but it is also necessary in some instances in order to accomplish tasks where DNN (or any framework) does not have an appropriate solution for. 


Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...adding my own javascriptadding my own javascript


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