Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Resources

Jeremy Farrance edited this page Oct 17, 2020 · 5 revisions

The proper way to get DNN to include a resource on a page is to use either DnnJsInclude or DnnCssInclude. You can do this in themes using the SkinObjects, in code by calling these functions, or even just dropping them on the page as needed (see /Portals/0/2sxc/Content/Shared/_Assets.cshtml for examples).

Example (not recommended) showing both ASYNC and DEFER

<dnn:DnnJsInclude 
  FilePath="https://kit.fontawesome.com/9999999999.js"
  ForceProvider="DnnFormBottomProvider"
  Priority="100"
  HtmlAttributesAsString="async:async,defer:defer,crossorigin:anonymous"
  runat="server"
/>

Results in:

<script src="https://kit.fontawesome.com/90e9235c3d.js" async="async" defer="defer" crossorigin="anonymous" type="text/javascript"></script>

Recommended (for Accuraty projects)

The following ones have been researched and tested, these are the RECOMMENDED settings for getting these things on the page and for AccuThem these normally these appear in /Portals/_default/skins/AccuTheme/includes/_preheader.ascx.

FontAwesome Pro Kit

Last reviewed 20201017 JRF

<dnn:DnnJsInclude
  FilePath="https://kit.fontawesome.com/0123456789.js"
  ForceProvider="DnnFormBottomProvider"
  Priority="100"
  HtmlAttributesAsString="async:async,defer:defer,crossorigin:anonymous"
  runat="server"
/>

Adobe TypeKit CSS include

Last reviewed 20201017 JRF

<dnn:DnnCssInclude
  FilePath="https://use.typekit.net/nnnnnn7.css"
  Priority="1"
  HtmlAttributesAsString="async:async,defer:defer"
  runat="server"
/>

Notes:

  • we like to pronouce "resources," "race horses."
Clone this wiki locally