Westco SXA Extensions is a set of extensions for Sitecore Experience Accelerator module.
Solution follows Helix.
Current Westco SXA Extensions project is compatible with:
Product | Version | Revision |
---|---|---|
Sitecore | 8.2 | rev. 171121 |
SXA | 1.6 | rev. 180103 |
Getting started is fairly straightforward. Install the package.
Create a new tenant and ensure that the Westco Theming feature is enabled.
Create a new site and ensure that the Westco Geospatial and Westco Maps features are enabled. These two are similar to those OOTB with SXA but offer a Static Maps component.
In the Media Library you simply create new Assets to represent your JavaScript and CSS resources from a CDN.
Note: The Url, SRI, and CORS values are all made available by the CDN.
You can associate assets at a site level by specifying on the Settings item in the Asset Configuration section.
You can associate assets on a page level by specifying in the Asset Configuration section.
Finally, see that the Html is injected in the <head>
and <body>
.
The final Html output may look like the following:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="/-/media/Assets/jquery/jquery-3-2-1/Scripts/optimized-min.js?t=20170614T032244Z">\x3C/script>')</script>
<script>console.log('Run after CDN link and fallback test.');</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js" integrity="sha256-1hjUhpc44NwiNg8OwMu2QzJXhD8kcj+sJA3aCQZoUjg=" crossorigin="anonymous"></script>
The configured mode determines the type of html to generate.
- Disabled : Asset is ignored completely.
- Script : Asset and raw content rendered using
<script>
. - ScriptAsync : Same as Script plus the
async
attribute. - ScriptDefer : Same as Script the
defer
attribute. - Style : Asset and raw content rendered using
<style>
and<link>
.
The details needed for specifying the Url and SRI can be found on cdnjs.com
Michael West |