Skip to main content
Home  ›  Docs › CSS and JS

Bundling and Minification of necessary JS and CSS Files


Important: new docs available

This information has been improved so it's best to continue in the new docs.
This page is currently still left here so old links will continue to work, but the content is not updated any more.


Warning ⚠️: New Docs Available

These are old docs and we haven't found the time to completely move them. You will find comprehensive new docs on docs.2sxc.org.

Introduced in Version 04.00.00

 

This helps you create a template with everything it needs (so also pointing to small JavaScript and CSS files), and letting DNN handle the packaging, compression and everything automatically! In case you've never used this DNN feature before, please read up on it on the official site.

This is done automatically using the DNN-Features. All you have to do is extend your tags like this:

  • Token Example
    • <link rel="stylesheet" href="[App:Path]/Sexy Feature List/Assets/style.css" data-EnableOptimizations="true" />
    • <script src="[Portal:HomeDirectory]/2sxc/Sexy Feature List/Assets/scripts.js" type="text/javascript" data-EnableOptimizations="true"></script>
  • Razor Example
    • <link rel="stylesheet" href="@App.Path/Sexy Feature List/Assets/style.css" data-EnableOptimizations="true" />

New feature in Version 6

Now we can also set the priority. This is important because DNN has a bug that re-orders the JS-files depending on login or not. So by using a number instead of true, you can set priorities. We recommend always using numbers above 100!

  • <link rel="stylesheet" href="[App:Path]/Sexy Feature List/Assets/style.css" data-EnableOptimizations="true" />
  • <script src="[App:Path]/Sexy Feature List/Assets/scriptsCore.js" type="text/javascript" data-EnableOptimizations="201"></script>
  • <script src="[App:Path]/Sexy Feature List/Assets/scriptsAdditional.js" type="text/javascript" data-EnableOptimizations="202"></script>
Tags for this feature
Design HTML and CSS JavaScript