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, ...Best place for CSS used in HTML moduleBest place for CSS used in HTML module
Previous
 
Next
New Post
2/27/2012 12:04 PM
 

We're adding some FAQs with the html module and we're going to reuse the same CSS/jQuery on multiple portals.

Where is the best place to store the CSS and how do I reference it in the HTML module? 

I've heard I can add a style tag to our main Default.aspx page, or just add the CSS via the CMS (Admin - Site Settings - Stylesheet Editor) but I'm wondering what is the best practice for DNN.

Thanks

 
New Post
2/27/2012 4:36 PM
 
If you need to use the same CSS across multiple portals, I would add it into either the Skin.css file (assuming they all use the same skin, or you have access to edit all the Skin.css files).

You could also add it to /portals/_default/default.css which gets loaded on every page of every portal in a DNN instance.

The /portals/#/portal.css file is specific to each portal, so if you want it across multiple portals you'll have to add it to multiple portal.css files.


Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
2/28/2012 7:32 PM
 

Thanks Chris. Since I had to add both CSS and jQuery files, I decided to just change the website/Default.aspx page to include references to my .css and .js files (rather than change the Default.aspx file AND the _default/default.css file - which worked great btw).

Ultimately I added a <script /> tag for the .js file and a <link /> tag for the css in the Default.aspx file. Then I added:

website/Resources/Shared/
  - scripts/myFile.js
  - stylesheets/myFile.css

Thanks for the reply!

 
New Post
2/28/2012 7:51 PM
 
you shouldn't modify default.aspx, because your changes will get overwritten on upgrades. DNN 6.1 introduces the new client dependency framework, you should have a look at it (there is some documentation at wiki.dotnetnuke.com)

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Best place for CSS used in HTML moduleBest place for CSS used in HTML module


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