Skip to content

Sitecore Experience Accelerator (SXA) extensions

License

Notifications You must be signed in to change notification settings

michaellwest/westco-sxa-extensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Westco SXA Extensions

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

License

Setup

Getting started is fairly straightforward. Install the package.


Asset Include

Create a new tenant and ensure that the Westco Theming feature is enabled.

Imgur

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.

Imgur

Assets served by a CDN with local fallback

In the Media Library you simply create new Assets to represent your JavaScript and CSS resources from a CDN.

Imgur

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.

Imgur

You can associate assets on a page level by specifying in the Asset Configuration section.

Imgur

Finally, see that the Html is injected in the <head> and <body>.

Imgur

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>

Asset modes

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>.

Url and SRI

The details needed for specifying the Url and SRI can be found on cdnjs.com

Imgur


Michael West
Michael West