Basker Docs

Block Studio

See the blocks of your site in Design → Blocks, and create and edit a code block with Block Studio and its assistant

A code block is a block that you create for your site in Basker. Block Studio is the editor for code blocks. It has an assistant that writes a block from a description, a live preview, the fields of the block, and its code. When you save a code block, editors can add it to pages from the Add Block panel.

Block Studio works on a site with a custom theme and on a site with a Website Builder theme.

What Design → Blocks shows

Open Design → Blocks. The list on the left shows the blocks of the selected site in two groups:

  • Theme blocks: the blocks of a custom theme. A theme developer makes these blocks. See Block Studio for theme developers.
  • Code blocks: the blocks that people on your site made in Block Studio. Each code block shows Published or Draft, and when it was last edited.

Use Search blocks to find a block by name. Select a block to see its fields and its code. Copy copies the code. Edit in Block Studio opens the block in Block Studio.

Create a code block

Open Block Studio

Open Design → Blocks and click New block. Block Studio opens with What do you want to create?

Describe the block

In the description box, write what the block shows, what editors can change, and any rules, for example the number of buttons. To start from an example, click Event spotlight, Season highlights, or Press quotes under Start from an example. The example fills the box. You can change the text.

Generate the block

Click Generate block, or press Cmd + Enter (macOS) or Ctrl + Enter (Windows and Linux). Block Studio shows each step while it builds the block. To stop, click Cancel.

Check and change the block

Block Studio opens the editor with the new block. Check the preview, and ask the assistant for changes. See The parts of Block Studio.

To write the block yourself, click Start from a blank block.

If Block Studio cannot generate the block, it shows an error. Your description stays in the box, and Basker saves nothing. Click Try again, or click Start from a blank block.

Block Studio makes the new block for the kind of theme that your site uses: a custom theme or a Website Builder theme. You cannot change this after you save the block.

The parts of Block Studio

  • The assistant: on the left, under Design Assistant. Ask for a change, or edit the fields and the code yourself. The name of the block is at the top. Click Hide assistant to close the assistant and Show assistant to open it again.
  • The toolbar: at the top. Click Preview, Fields, or Code to change the view. In Preview, click Desktop or Mobile to change the preview width.
  • The preview: the block with sample content. If the block cannot show with the sample content, the preview shows the error. Click Fix with AI to ask the assistant to fix it, or Show in code to see the code. While the code has an error, the preview shows the last version that worked. Click View error to see the error in the code.
  • Content and Accessibility: below the preview. Content sets the sample values of the fields. Accessibility checks the preview. It lists the results under Violations, Passes, and Inconclusive. Click Fix with AI to ask the assistant to fix the violations. Automated checks find only some problems. Also test the block with a keyboard and a screen reader.
  • Fields: the fields that editors fill in when they use the block. Under Details, Thumbnail icon sets the icon of the block in the Add Block panel. If you leave Handle empty, Basker makes it from the name. You cannot change it after you save the block.
  • Code: the code of the block. Problems below the code lists the errors in the code and the fields. Click a problem to go to it. Click Fix with AI to ask the assistant to fix all the problems.

A block must show correctly when any field is empty. If the block fails with the sample content, the preview shows The block failed with this sample content. Blocks must render when any field is empty.

The More menu

The More menu at the top right of a saved code block has these items:

  • Where used: the pages that use the block.
  • Version history: the earlier versions of the block. Click Restore to load a version into the editor. Then save the block to keep the version.

When you open Block Studio from a page, the menu does not show Version history.

Save a code block

The save button is at the top right. You cannot save while Problems lists an error.

  • Save: publishes the block. Editors can add the block to pages, and each page that uses the block shows the change.
  • Save draft: shows when your role cannot publish themes. Basker saves a draft. It shows Draft saved. Someone with publish permission must save it before pages can use it. Pages do not use the block until a person with permission to publish themes saves it.

To leave Block Studio, click Exit. If you have changes that are not saved, Basker asks you to confirm. Click Keep editing to go back to the block.

AI credits

Each Generate block request and each assistant request uses the weekly AI credits of your site.

Permissions

ActionPermission
See Design → BlocksManage themes, the Blocks tab permissions, or Code Blocks → Edit
See the code of a theme blockManage themes
Create and edit code blocks (New block)Code Blocks → Edit
Save a code block for pages to useCode Blocks → Edit, and publish themes
Edit a theme block in Block StudioManage themes, and Code Blocks → Edit

A role without permission to publish themes can delete only a code block that was never published. See Permission rules reference.

Where to go next

On this page