You can use HTML blocks to quickly access and edit complex HTML code in your content blocks and articles. HTML blocks let you work with blocks of code that would otherwise not be editable within the editor, and display them in a safe manner within your help center.
About HTML blocks
With HTML blocks, you can copy and paste unsupported code for HTML elements into the source code editor. The code is then wrapped in an HTML block and displayed within the article or content block. You can click the HTML block to open a source code editor that displays only the code for that block. You can use this focused view to manipulate the HTML for your selected content without scrolling through the source code for the entire content block or article.
When you update the content block or article, HTML elements associated with the HTML block appear in all published articles or content blocks that contain the HTML block. You can use HTML blocks for any block of unsupported HTML code, including complex HTML scripts or elements such as tables of contents, accordions, tabs, or steppers.
Creating HTML blocks
- In help center or Knowledge admin, create or edit a content block.
- In the content block editor, click HTML on the toolbar.
- In the source code editor, create or edit the unsupported source code you want to use.
- Click Apply to save the code and return to the content block editor. The
unsupported code appears as an HTML block within the editor. You can click the HTML
block to display additional options, or you can click and drag the block around the
editor to move the element to a new location.
- In the help center or Knowledge admin, create or edit an article.
- Click the Article components button (
) on the article editor toolbar, then select HTML block.
- In the HTML block editor, create or edit the unsupported source code you want to use.
- Click Insert to save the code and return to the article editor.
The unsupported code appears as an HTML block within the editor.
You can click the HTML block to display additional options or you can click and drag the block around the editor to move the element to a new location.
Editing HTML blocks
HTML blocks let you easily locate and work with the source code for that block. Instead of scrolling through the source code, you can access and edit the source code for the HTML block directly from the content block or article editor.
- Open the article or content block that contains the HTML block you want to edit in Edit mode.
- Click the HTML block you want to edit to display the option icons, then select the
edit icon (
).
The HTML block editor opens in edit mode.
- Make any necessary changes in the HTML block editor.
- Click Apply.
Your updates are saved and visible in all articles and content blocks that contain the HTML block. You do not need to republish the articles for the changes in content blocks to appear.
Unlinking HTML blocks
You can unlink HTML blocks to inline the HTML block and remove any unsupported markup from the content. You can preview the code that will be removed prior to unlinking it.
- Open the article or content block that contains the HTML block you want to edit in Edit mode.
- Click the HTML block you want to delete to expose the option icons, then select the
unlink icon (
).
-
Review the code that will be unlinked to make sure you understand what will be removed. To continue, click Unlink.
The HTML block is unlinked and unsupported code is removed.
- Click Update (for content blocks) or Save (for articles).
The HTML block is unlinked in all content blocks and articles.
Deleting HTML blocks
Deleting HTML blocks removes the block, including the text and code within that block, from the article. When you delete an HTML block, the block is immediately removed, without confirmation, and can't be undone.
- Open the article or content block that contains the HTML block you want to edit in Edit mode.
- Click the HTML block you want to delete to expose the option icons, then select the
delete icon (
).
The HTML block is removed, without confirmation.
- Click Update (for content blocks) or Save (for articles).
The HTML block is deleted in all articles in which the content block appears.