StoreSpan
Blocks

Blocks overview

What a block is, when to make one, the kinds of block you can create, and how to read the Blocks list.

A block is a piece of content you build once and use in many injectables. Change the block, and every injectable that uses it changes with it.

Take a free shipping notice. It appears on your home page banner, on your cart banner and on a product page strip. As three separate injectables, a change to the wording means three edits. As one block used by all three, it means one.

The Blocks list of a store, with each block's kind, number of variables and how many injectables use it

When to make a block

Make a block whenKeep the content inside the injectable when
The same content shows in more than one place.The content is used once.
Several injectables share a design and differ in a few words or colours.Nothing about it is shared.

Two kinds of block can leave values open for each injectable to fill in, such as a headline or a colour. These are variables. See Variables.

The Blocks list

Open Storefront › Blocks in the left menu. Press New block to create one.

ColumnWhat it shows
NameThe block's name. Press it to open the block.
KindWhat kind of content the block holds.
VariablesHow many variables the block has.
Used byHow many injectables use the block.
Statusactive or archived.
UpdatedWhen the block was last saved.

When your store has no blocks, the page says No blocks yet. Create one to reuse the same content across injectables.

Kinds of block

You choose the kind under Content type when you create a block.

Content typeShown in the list asWhat it holds
HTMLHTMLHTML, placed on the page as you wrote it.
Custom HTML & CSSHTML & CSSHTML with its own CSS, which stays inside the block. Can have variables.
TemplateTemplateHTML with {{ }} variables. Can have values of your own.
Design presetPresetA ready-made design that you fill in.
CountdownCountdownA timer that counts down to a date.
ScriptScriptJavaScript that runs on your storefront.

The Blocks list shortens two names: Custom HTML & CSS is listed as HTML & CSS, and Design preset as Preset.

Each content type has the same editor as in an injectable. See Content types for the fields of each one.

What a block cannot be

  • A Mega menu, a Kit or a page made in the visual builder. Create those as injectables.
  • A stack of other blocks. To combine blocks, build a Blocks injectable. See Combine several blocks.
  • A carrier of External CSS. A block sits inside other content, so it must not restyle the page around it.
  1. Create a block
  2. Variables
  3. Use a block in an injectable
  4. Combine several blocks
  5. How a block is styled
  6. Archive a block

On this page