Pushing a Block to a Staging Environment

In this article, we cover the steps needed to publish a block to the staging environment for use in your store.

Make Sure That All of Your Tests Pass

This is a requirement to publish your block. If you haven’t already set up a Git repository for your block, you'll want to run

git init

Open a new tab for your directory, and run 

npm run test

This will set up a watch task for all of your blocks. Ideally you are doing this as you are developing, so anytime you save a file, it will automatically run all your tests again and let you know if your change has broken anything.
 

Publish Your Block

Open a new tab in Terminal and run 

npm run build

This will run all the tests to make sure everything is passing. Once it compiles the files, run `element publish`

 Pass the n flag for a name, and provide the public-facing name of your block in quotes. 

Select the category that best fits your block—this will be how the block is actually sorted in the UI. There will not be a thumbnail yet, but you’ll be able to see that it has been published to staging with your ID.
 

Using Your Block

Log in to Volusion with your store credentials and go to Site Designer. If your theme does not automatically pop up, click “Edit,” and you’ll see all of the sections you can edit. 

To add your block, click the blue plus sign, scroll down to the category of your block, find your newly created block, and click “Add Block” to add it to your theme.