1. The SXA themes

The base themes

Version:

Base themes are prototype themes that predetermine the layout of a website. You can have several base themes to support different design philosophies or specific functionality.

Base themes contain scripts and styles that deliver more complicated functionalities. For example, shared functionalities such as the Bing/Google maps connector, Core Libraries (jquery, lo-dash), and scripts that influence the editing experience (sticky notes, editing themes, drag and drop, and partial designs highlighting).

The base themes are saved in the Media Library: /sitecore/Media Library/Base Themes.

Analytics

The Analytics base theme adds analytic scripts for your site (Google analytics). It is dependent on XA.js (XA API theme).

It includes the following scripts:

ScriptDescription
trackinginit.jsAdds a tracking method to SXA's XAContext variable. After calling this function on document ready, an event will initialize tracking of video components.
tracking.jsAdds Google Analytics scripts. After calling this function on document ready, it will store the methods and setups for these scripts to run.
trackingmovie.jsAdds the Tracking.Movies method to SXA's XAContext variable. Stores the method for mejs and YouTube player analytics.
trackingmoviesplayer.jsDescribes the method of the video player. Used in trackmoviesmejsplayer.js.
trackingmoviesplayermanager.jsExtends SXA's XAContext variable with the Tracking.Movies.PlayerManager script and stores methods for the video player.
trackingmoviesyoutubeplayer.jsExtends SXA's XAContext variable with the Tracking.Movies.YouTubePlayer script. Stores list of YouTube player methods.
trackingmoviesyoutubeplayerhandlers.jsExtends SXA's XAContext variable with Tracking.Movies.YouTubePlayer.Handlers. Stores YouTube player handlers.

Bing Maps JS Connector

Add the Bing Maps JS Connector theme if you use Bing maps. It is dependent on the [XA.js](the-base-themes.html#UUID-c780da7c-8ab4-2df9-74ab-948dd32688df_N1558513605695 "XA API") (XA API theme).

It includes the following script:

  • bing-maps-connector.js - injects functionality for Bing maps.

Google Maps JS Connector

Add the Google Maps JS Connector theme if you use Google maps. It is dependent on the [XA.js](the-base-themes.html#UUID-c780da7c-8ab4-2df9-74ab-948dd32688df_N1558513605695 "XA API") (XA API theme).

It includes the following script:

  • google-maps-connector.js - injects functionality for Google maps.

Grid

The Grid theme is used during content editing. It lets you show components that are hidden by the grid and includes the following script:

  • gridhiddencomponents.js – show or hide components that are hidden by the grid.

The Grid theme includes the following style:

  • gridhiddencompontents.css

JSON

The JSON theme is used when a current device selects JSON. It adds markup and styles to highlight JSON and it includes the following script:

  • jsonhighlighter.js - formatting and syntax highlighting to make JSON more readable.

The JSON theme includes the following styles:

  • prism.css – styles for highlighting JSON
  • Json.css – sets default styles for JSON page

Main theme

The Main theme contains scripts and styles that are part of the platform (except for the rendering scripts). The Main theme has a dependency on the Core libraries theme, so if you are inheriting from it, you must also inherit from Core libraries first. It is dependent on the [XA.js](the-base-themes.html#UUID-c780da7c-8ab4-2df9-74ab-948dd32688df_N1558513605695 "XA API") (XA API theme)

The Main theme includes the following scripts:

ScriptDescription
observer.jsCalls the XA.init method on Chrome reset.
partial-design-highlight.jsHighlights the partial design when you hover over different designs from the drop-down menu in edit mode.

The Main theme includes the following styles:

StyleDescription
core.cssGrid specific fixes.
file-type-icon.cssStyles for extension icons.
grayscale-mode.cssStyles for Gray Scale mode.
reset.cssReset default browser styles.

Maps

You must use the Maps theme if you use the Maps.Dependent script in the [XA.js](the-base-themes.html#UUID-c780da7c-8ab4-2df9-74ab-948dd32688df_N1558513605695 "XA API") (XA API theme).

The Maps theme includes the following style:

  • component-location-service.js – location service for the map component.

Meta partial design

The Meta partial design theme stores scripts and styles for meta partial designs.

It includes the following scripts:

  • beautify-html.js – calls the beautifier method for html.
  • meta-partial-design.js – selects all components in the meta partial design view and calls the beautify method.

It includes the following styles:

  • meta-styles.css - styles for the meta partial design page.

Search theme

The Search theme contains js logic for each separate search component.

Search theme js logic

Sticky notes

The Sticky notes theme provides the possibility to add sticky notes in Edit mode.

It includes the following script:

  • stickynotes.js - js logic for sticky node functionality

It includes the following styles:

  • stickynotes.css - styles for sticky nodes functionality

Variants

The Variants theme provides the possibility to change rendering variants for components in Edit mode.

It includes the following script:

  • variantswitcher.js - provides functionality for changing rendering variants in the Experience Editor.

XA API

The XA API theme registers components.

It includes the following script:

  • xa.js - injects special SXA objects that include the method for working with components and additional helpers.

Core libraries

The Core libraries theme includes the third-party libraries used in projects such as jquery, jquery UI, lo-dash, mediaelement, modernizr, and so on.

The Core libraries theme includes the following scripts:

ScriptDescription
Ie-origin-fix.jsAdds a fix for IE to have location.origin.
xaquery.jsInitializes jQuery and jQuery UI and puts them into window.$xa.
moment.jsThe momentjs.com library to work with date/time functionality.
lo-dashAdds the lo-dash library.
modernizr.jsAdds the modernizr library.
galleria-157.jsAdds the galleria library.
fullcalendar.jsAdds the full calendar library.
gcal.jsAdds the Google calendar.
jqueryuitouch-punchmin.jsAdds touch events for jQuery UI.
hammer.jsAdds the hammerjs library.
backbone-min.jsUsed in search components and the maps component.
typeahead.jsUsed in search components.
jquerymCustomScrollbar.jsAdds a custom scrollbar for the SXA toolbox.
flash-polyfill.jsAdds polyfill for the flash component.
mediaelement-and-player.jsAdds a library for the video component.
facebook.jsAdds a connector for Facebook video.
soundcloud.jsAdds a connector for SoundCloud.
twitch.jsAdds a connector for Twitch.
vimeo.jsAdds a connector for Vimeo.

The Core libraries theme includes the following styles:

StyleDescription
mediaelementplayer.cssMedia element styles.
mediaelementplayer-legacy.cssLegacy styles for the media element.
font-awesomemin.cssStyles for the font-awesome library.
mejs-controls.cssStyles for the mejs control elements.
fullcalendar.cssStyles for the calendar component.
querymCustomScrollbar.cssStyles for the custom scrollbar (SXA toolbox).
jquery-ui.cssStyles for the jquery UI components.

Editing theme

The Editing theme adds logic that is used to edit components in the Experience Editor.

The Editing theme includes the following scripts:

ScriptDescription
xamover.jsDrag and drop helpers. Provides methods that help to work with placeholders.
initializer.jsInitializes xamover functionality.
draganddrop.jsSXA drag and drop functionality,
gridlines.jsVisualization of grid columns.
toolbox.jsSXA toolbox logic.
treeview.jsExtends Sitecore.Treeview with a method that returns data context.
popupsGecko toolbox.jsExtends scBrowser for Gecko.

The Editing theme contains the following styles:

StyleDescription
edit-here-hint.cssFixes behavior for the edit-here-hint element.
sx82fonts.cssExports open Sans fonts from Google.
toolbox.cssStyles for the SXA toolbox.
xamover.cssStyles for drag and drop functionality.
partialdesignhighlight.cssHighlight partial design placeholders.

Editing Components

The Editing Components base theme stores logic for components that have special behavior in editing mode.

The Editing Components theme includes the following scripts:

ScriptDescription
component-accordion-edit.jsLogic for the accordion component in editing mode.
component-tabs-edit.jsLogic for the tabs component in editing mode.
component-galleria-edit.jsLogic for the galleria component in editing mode.
component-overlay-edit.jsLogic for the overlay component in editing mode.
component-carousel-edit.jsLogic for the carousel component in editing mode.
component-flip-edit.jsLogic for the flip component in editing mode.
component-snippet-edit.jsLogic for the snippet component in editing mode.

Resolve conflicts

The Resolve conflicts theme resolves conflicts when you open the Experience Editor within the Content Editor window.

The Resolve conflicts theme includes the following script:

  • Resolveconflicts.js - resolves conflict between JQuery and prototype.js.

Components theme

The Components theme stores the js logic for all SXA components:

SXA-base-theme-component-scripts.PNG
If you have suggestions for improving this article, let us know!