Brightspot Content Types Guide

Code block


Code blocks are blocks of text you can add to your assets. Brightspot formats code blocks according to the type of code you select. Code blocks can either be created as inline enhancements to only be used in a single asset, or they can be created as a shared enhancement to be used across many assets.

To create a code block:

Note
This topic shows how to create a shared code block; however, the steps to create an inline code block are nearly identical. To create an inline code block, click photo > Code Block in the rich-text editor toolbar, select Inline, and complete the fields in the table below.

  1. In the header, click add. By default, when you select to create a code block from this menu, you are creating a shared code block.
  2. From the Create list, select Code Block.
  3. Using the following table as a reference, complete the fields as needed.
  4. Complete your site's workflow and publish the asset.

Code Block fields

Click each tab below to see a description of the associated fields.

FieldDescription
Internal NameEnter an internal name for this asset. Brightspot uses this name internally, such as in the search panel and recent activity widget. This name is not visible to visitors to your site.
TitleEnter a title. This title is not visible to the visitors to your site.
Code TypeSelect the type of code block you are entering from the list of available programming languages.
CodeEnter the code as you would like it to display.
AnnotationsYou can add annotations to your code block to provide further clarity for your visitors.
  1. Click add_circle_outline.
  2. Expand the Line Number field and select the line of code to which you want to associate an annotation.
  3. Enter the annotation in the Annotation field.
Annotations have the selected line highlighted in the code block, with the annotation appearing below the code block.

The information on this tab presents a graphical or tabular representation of this asset's analytics. For information about configuring analytics ingestion and presentation, see Brightspot Analytics and Google Analytics.

FieldDescription
LocaleChoose a locale for the translation you want to submit.

Note
On your site, code blocks have a Copy button to allow your visitors to copy the code in the code block and reuse it.

See Embedding a code block in the rich-text editor for information on placing a code block in your assets.

Previous Topic
Callout module
Next Topic
Container module
Was this topic helpful?
Thanks for your feedback.
Our robust, flexible Design System provides hundreds of pre-built components you can use to build the presentation layer of your dreams.

Asset types
Module types
Page types
Brightspot is packaged with content types that get you up and running in a matter of days, including assets, modules and landing pages.

Content types
Modules
Landing pages
Everything you need to know when creating, managing, and administering content within Brightspot CMS.

Dashboards
Publishing
Workflows
Admin configurations
A guide for installing, supporting, extending, modifying and administering code on the Brightspot platform.

Field types
Content modeling
Rich-text elements
Images
A guide to configuring Brightspot's library of integrations, including pre-built options and developer-configured extensions.

Google Analytics
Shopify
Apple News