Sunday, July 18, 2021

Create a Theme Using SXA CLI

 ØCreate a new Theme

ØBuild, compile and minify the Theme assets

ØUpload Theme assets to Sitecore

ØAutomatically synchronize the front end related assets with Sitecore

Create a Theme

We need NPM and Node, already I have installed them in my system


1. Go to Website\App_Config\Include\z.Feature.Overrides and enables the z.SPE.Sync.Enabler.Gulp.config.disabled file.

2. Open a command prompt terminal and install the registry:

npm config set @sxa:registry=https://sitecore.myget.org/F/sc-npm-packages/npm/

3. Use npm and the install command to install SXA CLI as a global package: npm i -g @sxa/CLI.


4. Create a new folder in my solution file

mkdir "-\media\Themes\Demo SXA Sites\SXA Demo"



5. Go to the created directory

cd "-\media\Themes\Demo SXA Sites\SXA Demo"



6. Run sxa register <url>.

sxa register https://sc101.dev.local/

For the <url>, enter the instance for which you want to create the theme.

Use sxa get-url for get the registered site instance name

7. Run sxa new <ThemeName>.

Optionally, you can enter the name of the new theme (<ThemeName>).

 sxa new SXADemoNew



Check the created theme in Sitecore content editor


How can we Automatically synchronize the front-end related assets with Sitecore?

       You can run "gulp" in the theme folder and start making your edits in VS.Your theme will compile locally and upload the compiled assets to sitecore






No comments:

Post a Comment

Steps to follow when using a PowerShell script to modify the goals in Sitecore

I have previously utilized PowerShell for item creation, modification, deletion, and presentation details in Sitecore.   Ø Recently, I attem...