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 > Code Block in the rich-text editor toolbar, select Inline, and complete the fields in the table below.
- In the header, click . By default, when you select to create a code block from this menu, you are creating a shared code block.
- From the Create list, select Code Block.
- Using the following table as a reference, complete the fields as needed.
- Complete your site's workflow and publish the asset.
Code Block fields
Click each tab below to see a description of the associated fields.
Field | Description |
Internal Name | Enter 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. |
Title | Enter a title. This title is not visible to the visitors to your site. |
Code Type | Select the type of code block you are entering from the list of available programming languages. |
Code | Enter the code as you would like it to display. |
Annotations | You can add annotations to your code block to provide further clarity for your visitors.
|
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.
Field | Description |
Locale | Sets the content's locale. This setting can also be used to auto-localize content based on the users requested locale. |
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