The Mighty Blog

Feb9

Written by:Will
2/9/2009  RssIcon

I was looking through some of the Client API and Widget code tonight, and ended up finding a setting that you might find interesting.

There may be times or installations where you might want to prevent or disable the use of the new Widget feature in DotNetNuke 5.  Why would you want to do that?  I don't know, but you do.  :)

Perhaps you don't want to allow the client-side overhead, or maybe you don't want content editors to put skin widgets into the Text/HTML Modules.  In any case, you have the ability as the Portal Admin to enable and disable skin widgets per portal.

Go to your Admin Menu, and select the Site Settings page.  In the Basic Settings > Appearance section, there is a simple checkbox that will be used to enable or disable the skin widgets in DotNetNuke.

DotNetNuke 5 - Skin Widget Setting

Simply check or uncheck the checkbox as appropriate to enable/disable the skin widgets for the portal.

So how does it work?  By default, that checkbox is checked.  When it is checked, the DNN core adds the following script into the HTML markup:

~/Resources/Shared/scripts/initWidgets.js

If the checkbox is unchecked, that file is NOT added.  However, one thing confuses me.  There is another file there called init.js.  In just looking at the code alone, it would seem that this file should be added to the markup in the place of initWidgets.js, but that is simply not happening.  In turn, the DotNetNukeAjaxShared.js file is not loaded either.  Hopefully, I am dead wrong.  :)

Technorati Tags: , , , ,

Copyright ©2009 Will Strohl

6 comment(s) so far...


Gravatar

Hey Will,
I have been searching for Tutorials and information regarding DNN widgets.
First of all thanks very much for your contributions.
I was wondering though if you would mind sharing any links know of that may provide additional information regarding DNN widgets. I am finding surprisingly little info.

Thanks

By Phil Speth on   11/17/2009
Gravatar

There are indeed few resources about the widgets. What do you want to know? I will blog about it.

By Will on   11/17/2009
Gravatar

Hi Will,
Thanks for this short article.
After compression (JS, CSS) of my site I get continuity of execution of some functions in initWidgets.js which kills my bloody Firefox :)
Did you have similar experience guys?

Kind Regards,
Jonas

By Jonas on   3/8/2010
Gravatar

@Jonas Are you using PageBlaster to compress the JS and CSS? If so, I've had different results on different sites. I generally do not compress JS with PageBlaster on any of my sites to prevent postback and other JS issues.

By Will on   3/8/2010
Gravatar

Hey Will,

It would be good if this could be done at Page Level don't you think? I have some pages that use Jquery and some pages that don't - then I could reduce the client overhead on those pages that don't use it...

I might raise that as a core feature request - what do you think?

cheers
Rodney

By Rodney on   6/9/2010
Gravatar

I think you're right. After all, we already have this indirectly exposed at the module level. It definitely would be nice to have that kind of granular control over page overhead - but I am not sure how fast an update like this will make it into a build. I'd support the idea though. :)

By Will on   6/9/2010

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel 
Add to Technorati Favorites
Tweet about my blog
Will Strohl - The Mighty Blog - RSS Feed

Tag Cloud

Sort by:Tag | SizeRSS
camp   community   dnn   dotnetnuke   dotnetnuke®   event   example   free   get   group   integer   jquery   meeting   module   odug   orlando   search   session   think   use  
The opinions expressed here are the personal opinions of Will Strohl and do not necessarily represent the views and opinions of the DotNetNuke Corporation.
© Copyright 2004-2010 by Will Strohl. All rights reserved.Website Skinned By: Ralph Williams  Website Hosted By: Applied Innovations