After you create or insert a content block, you can edit the content block as needed. You must be a Guide admin or an agent with permission to update content blocks to edit and update content blocks.
When you update a content block, it is automatically updated in the articles in which it is used without impacting the article status. You can access the content block editor from the content block list or from any article using a content block. When you edit and update a content block, all articles containing that content block are automatically updated in your help center to include the new content without impacting the articles' publication status.
About editing HTML source code in content blocks
If you are a Guide admin or an agent with permissions to update content blocks, you can use the
content block editor to make changes to the content block and update all articles in which
the content block appears. You can also edit the block's HTML source by clicking the
Source Code () button at the end of the editor's toolbar.
class
and id
attributes from the HTML source of
content blocks, with the following exceptions:- Top-level
div
tags can use theclass
attribute. - Heading tags, such as
h1
andh2
, can use theid
attribute. If you don't specify anid
, Zendesk automatically assigns one to headings. Content blocks don't supporth5
orh6
headings.
If you are working with unsupported code, you can use HTML blocks to quickly access and edit complex HTML code in your content blocks. HTML blocks let you 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.
Editing a content block from the content block list
Guide admins can edit a content block from the central content block management list. When you edit content blocks from the content blocks list, you are editing the master version of a content block that doesn’t have any context of the articles in which it is used.
When you update the content block, your changes automatically appear in all published articles that contain it. To make sure you understand which articles will be automatically updated when you update a content block from this list, view the articles that contain the content block.
- In Guide, click Guide admin at the top of the page, then click the Manage
articles icon (
) in the sidebar.
- Under the Content objects tab in the left menu, click Content blocks.
- Click a content block to open the content block editor.
- Use the content block editor to make any necessary changes.
- Click Update. 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.
Editing a content block from within an article
Guide admins and agents with permission to update content blocks can edit and update content blocks. You can update a content block from within the article that contains it. When editing a content block from within an article, the article remains open in the background. To return to the article without saving the content block, click the breadcrumb in the upper left corner of the window.
To edit a content block from within an article that is using it
- Open the article that contains the content block you want to edit in Edit mode.
- Hover over the content block you want to edit, click the Options menu icon
(
), then click Edit.
- Make any necessary changes in the content block editor.
- Click Update all articles.
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.
8 comments
Kate Ives
Do content blocks not support the <span> element? I keep trying to add one and it gets turned into a <p> element. If not, please add support for this as it can be helpful for custom CSS.
2
Darenne
I hope you're doing great! I have confirmed with one of our project managers that content blocks are not supported <span> at the moment and this is not yet in the roadmap. We recommend that you file this as a feature request via this link. Your comment will be routed to our Dev and Product managers and they will check if they can consider this feature for future use.
Thank you so much and have a lovely day!
0
Elizabeth Brown
Hi Zendesk team - you say:
Why do you remove `class` attributes? It's the one attribute I add manually to text for formatting purposes, to create shaded backgrounds behind text.
I can now add colour backgrounds to content blocks but they don't look the same.
What's the rationale?
0
Hamish
Hey Zendesk,
The removal of classes means that although the Content Block editor allows text formatting within Tables, these are removed when you publish or save. So you can't center text in a table due to the way the classes get removed. This doesn't make sense as users should be able to format content within tables
0
Fiona
Is there a way to edit without publishing the changes right away, just like a regular article?
0
Shawna James
0
Justin Moore
Is revision control supported in any way for Content Blocks? I can't seem to find any way to view revisions for a Content Block, but it feels like the way that revisions are accessed for articles has changed several times recently, and it's currently somewhere very silly (the right-most level of the right-side vertical navigation frame). I do not see anything comparable in the interface view for Content Blocks.
If revisions aren't supported for Content Blocks then that seems like a major oversight and problem. Revision control is a critical part of information management for any type of documentation content!
1
Rebecca
Hi, I updated a content block and upon saving, every single article that contained it is now showing that as an actual edit/revision was made. Can you confirm if this behavior is new?
This was puzzling to try and figure out why so many articles suddenly appeared “edited"/changes published this morning, but they weren't actually article changes - they were just all articles that had the one content block. This might affect our tracking of “articles edited” and "changes published” stats, because a tiny edit to one word of a re-used content block is not a real “edited article”.
If someone could just confirm how the behavior currently works as of September 2024 that would be helpful to understand and plan around if necessary. Thanks!
0