You can use HTML blocks to quickly access and edit complex HTML code in your content blocks. HTML blocks enable you to work with blocks of code that would otherwise not be editable within the content block editor, and to display them in a safe manner within your help center.
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 content block editor. You can click the HTML block within the content block editor 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.
When you update the content block, the HTML elements associated with the HTML block appear in all published articles that contain the content block. You can use HTML blocks to include any block of unsupported HTML code in your content blocks, including complex HTML scripts or elements such as tables of contents, accordions, tabs, or steppers.
Creating HTML blocks
- In the help center or Guide admin, create or edit a content block.
- In the content block editor, click the source code icon (
) 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.
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 for the entire content block, you can access and edit the source code for the HTML block directly from the content block editor.
- Open the 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 that use the content block. You do not need to republish the articles for the changes to appear.
Removing HTML blocks
If you find that you no longer need an HTML block, you can remove it from the content block in which it appears. Removing HTML blocks from content blocks removes the HTML block immediately from all articles in which the content block appears.
- Open the content block that contains the HTML block you want to delete 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 from the content block.
- Click Update.
The HTML block is removed in all articles in which the content block appears.
5 comments
David Bjorgen
Thank you for adding this feature. Very helpful.
0
Patrick Morgan
I tried to edit the HTML code in a content block (only trying to add two special characters not supported by the WYSIWYG editor). After saving, all the content in the content block was converted into the HTML block and is no longer editable in the WYSIWYG editor. Is this expected behavior? I have no control over what content gets put in the HTML block.
0
Mario Guisado
Is this available in the Professional Plan? I don't have the ability to add a content block in Professional but the header to this article shows that this is available in all plans?
How do we use this if we can't create content blocks?
0
Katarzyna Karpinska
Hi Mario Guisado ,
Thank you for this question. At the moment the HTML blocks are only available in Content blocks, which are an enterprise feature (we have updated the banner at the top of the article). Later this year they'll be available also on lower plans in the article editor.
0
Molly Exten
HTML blocks are wreaking havoc on my code blocks. I use an LMS to manage translations for Zendesk articles, and every time I import a translation back to Zendesk now, code blocks that use angle brackets get swallowed up by an HTML block.
Really not a fan of this feature.
0