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, ...Controlling the module.css loading if not neededControlling the module.css loading if not needed
Previous
 
Next
New Post
6/5/2010 5:53 AM
 
I noticed a lot of modules load unnecessary .css when it is not needed. For example, most utility modules that are not actually visible on a page to the end user (without Edit Role) attach their module.css. Other modules put a lot of CSS into the module.css that is only needed when the module is in edit mode.

I currently use a CSS unloader to remove these .css files but it would be nice if the core module module.css loader could be more intelligent - I don't know exactly what the solution is, but thinking off the top of my head perhaps we need another moduleedit.css file (only attached when someone has Edit Rights on the module or when it is in edit mode). Then you could put styles in module.css that apply to all your forms and only edit css in the edit one.

Or maybe module developers just need to link to their own edit stylesheets in their module and stop using the default module.css functionality?

Or maybe some way of telling module.css to load only under certain conditions?

Ideas?

Entrepreneur

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

 
New Post
6/5/2010 12:39 PM
 
Nice suggestions, especially the ModuleEdit.css.  Expanding on this idea a bit ... load Module_<controlkey>.css where modulekey would be the same as defined in the module defintion.  This would include the your suggestion for ModuleEdit.css as Module_Edit.css as Edit is the controlkey.

Additionally, there might  be  cases where your do not want the default module.css to be loaded.  If a "Suppress CSS" option were added to the Module Settings, then if enabled, the loading of the module.css would be by-passed.  (default mode would be to allow the loading).

Thoughts? 
 
New Post
6/6/2010 6:42 PM
 
It's a good suggestion and something I hadn't thought of before. 
The simple solution is for the module developer to ignore the module.css file and to include the correct css files into their modules as needed.

The more complicated solution is to have an option somewhere in the module which allows control over which (if any) css files to emit with the module.
 
New Post
6/7/2010 8:38 AM
 
This is what I have come up with:

I am breaking my module css into 2 new files - ModuleName.css and ModuleNameEdit.css - any styles that only apply in Edit mode (Admin skin, until a page can support it's own edit skin) go into the 2nd one. You have to load them up manually in each ascx.

What I noticed in a lot of modules (including my own!) is very sloppy use of Module.css - any style gets bunged in there regardless on which views it is used. So I have a module with 10 different screens/.ascx files/satellite views, some of which don't even use the css file and yet if you put any view on a page the whole stylesheet is loaded by the core.

Hence if you are working on a view (.ascx) file in a module make a new style sheet (ModuleFileName.css) for just those styles if they are not used any where else.

I would recommend developers to stop using the Module.css until this is handled more efficiently in the core...

Entrepreneur

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

 
New Post
6/7/2010 8:45 AM
 
Paul Scarlett wrote:
Nice suggestions, especially the ModuleEdit.css.  Expanding on this idea a bit ... load Module_.css where modulekey would be the same as defined in the module defintion.  This would include the your suggestion for ModuleEdit.css as Module_Edit.css as Edit is the controlkey.

Additionally, there might  be  cases where your do not want the default module.css to be loaded.  If a "Suppress CSS" option were added to the Module Settings, then if enabled, the loading of the module.css would be by-passed.  (default mode would be to allow the loading).

Thoughts? 

I like the ControlKey idea - simple change and flexible (although View controls don't have a ControlKey...).  Great way of separating the Edit/Settings/View etc. css

I also like the ModuleSetting idea - keep it in the core...


Entrepreneur

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

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Controlling the module.css loading if not neededControlling the module.css loading if not needed


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