Extend the Storefront Branded theme
In Sitecore 9.2, scripts were moved out of the Storefront Branded Theme so that it only contained stylesheets. This was done to make it simpler to customize and extend the Storefront Branded theme, and to ease the transition from one version of SXA Storefront to the next.
Script |
Description |
---|---|
|
Determines whether the browser is using the mobile version or not. |
New location: Old location: | |
(previously component- |
Handles the slide transition in the carousel component. |
New location: Old location: | |
(previously |
Contains the click event handler for the product image component. |
New location: Old location: | |
(previously |
Contains the event handlers for the controls in the product quantity component. |
New location: Old location: | |
|
Handles styling changes for the category navigation component. |
New location: Old location: | |
|
Contains submit and AJAX event handlers for all form components. |
New location: Old location: | |
|
Handles display transition of the language selector component. |
New location: Old location: | |
|
NA |
Script removed. | |
|
Contains the component initialization function for the product facet component. |
Script removed. Code moved into | |
|
Handles styling changes and contains the click event handler for the search bar component. |
New location: Old location: | |
(previously |
Handles display transition of the sub-category navigation component. |
New location: Old location: | |
(previously |
Handles display transition of the top bar links component. |
New location: Old location: |
You can access all scripts from the Content Editor by going to the /sitecore/Media Library/Base Themes
folder.
Extend a script
To extend a script:
-
In the Content Editor, go to
/sitecore/Media Library/Base Themes/Commerce Components Theme/Scripts
. -
Right-click the script you want to extend and click Scripts, Download.
-
In the editor of your choice, modify the script as required.
-
In the Content Editor, select the script and, on the Content tab, in the Media section, click Attach and then go to where the script is saved and click Attach.
-
On the Media tab, click Save.
-
On the Publish tab, click Publish to publish your changes.
Add a custom script
To add a custom script:
-
In the Content Editor, go to
/sitecore/Media Library/Extension Themes
. -
Right-click Storefront Branded Extension and click Insert, Scripts.
-
In the Message dialog box, enter a name for the new item and click OK.
-
Select the newly created scripts folder and, on the Folder tab, click Upload file.
-
In the Upload File dialog box, click Choose File and go to where the custom script is saved and then click Upload.
-
On the Publish tab, click Save.
-
On the Publish tab, click Publish to publish your changes.