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

HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...How do you add JQuery functionality to content?How do you add JQuery functionality to content?
Previous
 
Next
New Post
11/27/2011 7:35 PM
 

Not only am I new to DNN but I'm also very new to JQuery.  I am adding content for a client to one of the pages on his site and I'm using a JQuery plugin for an animation that is part of the content.  Since I'm new to JQuery I started by getting the animation working inside a simple html page.  It works perfectly there.  When I went to do the same thing on the DNN site I realized that if I put the style and script tags required for the animation in the skin ascx file then it would be used on all of the pages on the site - where I only need it on the home page of the site.  I tried putting the style and script tag content in the WYSIWYG content for the page but every time I save the html the script tag content is removed.  This didn't really surprise me since I know that it is preferred that the script tags be in the head section of the page.  However, I'm not sure what the best approach should be.  Should I make a unique skin ascx file just for the home page and then add my JQuery style and script info in the ascx file?  Although that might work, it does bring up the question of what to do if you have multiple instances on the same page of JQuery code.  It seems rather user unfriendly to have to create a unique skin for any page that uses JQuery.  What is the best approach for handling JQueyr style and script requirements for content on a DNN site?

Thank you in advance for any guidance.

 
New Post
11/27/2011 8:03 PM
 
I probably should have specified that the client I'm doing this for is using DNN 5.5 and at this time can not upgrade to 6.0.
 
New Post
11/28/2011 3:59 AM
 

For dnn5X

Put the jquery call in your .ascx skin file

Then in pages where you want to use jquery apply this skin

If you want to use script you need to put the editor in normal text mode with selection html , if you do that then the code wont be removed, another option is to edit the config files to make sure jst ags dont get filtered out

http://schwingsoft.com/Weblog/tabid/64/articleType/ArticleView/articleId/8/Quick-Tip-allow-for-Javascript-editing-in-the-RadEditor-provider.aspx

 
New Post
11/28/2011 9:42 AM
 

I ended up creating a copy of the skin ascx file specifically for the page using the plugin and I added the script to that file.  I tried using the second approach and putting the script in the content itself by switching over to the basic text box.  However that method required that I remove all formatting from the script and style tag content.  Otherwise it inserted BR tags in the script and style content for every line break.  That would be too much of a nightmare for maintenance - more than the custom skin ascx file.  I have not yet tried the third method you recommended.  Ultimately that might be the best way to go for this particular site.

 Thank you for your help.

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedNew to DNN Plat...New to DNN Plat...How do you add JQuery functionality to content?How do you add JQuery functionality to content?


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