Reusing content with content blocks

Return to top


  • Heather Firth

    Does anyone know if you can use a div in a list item in content blocks? It keeps throwing out my divs of my lists.

  • Tipene Hughes
    Zendesk Developer Advocacy

    Hey Heather Firth,

    The anchor element is likely being removed because it would be considered invalid markup. Can you try it with a closing tag and an href attribute i.e:

    <h2><a href="#" id="title2">Title2</a></h2>

    Edit: I've just become aware that the id attribute will be automatically removed from <a> tags when added manually via the content blocks code editor. I would suggest adding the id to the <h2> tag instead.

  • Jay Lee


    I resolved this issue by using <div> instead.  So, this gets around the issue (most likely Zendesk's "unsafe content" filtering):

    <div class="alert alert-info">warning text here</div>


    I am trying to create a content block for a disclaimer we often put on articles. As part of the disclaimer text, I'm trying to use this HTML code:

    <aside class="alert alert-info">warning text here</aside>

    However, after I save the content block, I find that this HTML code isn't saved and replaced with <p></p>.  And actually this seems to be the case with other HTML codes I try to save into a Content Block.

    Is this a known issue? I know there's a similar issue with dynamic content.  Please let me know if this is a known issue or if I'm doing something wrong, or if there is a workaround.  Thanks

  • David Bjorgen

    Jay Lee have you tried enabling the option to "Display unsafe content" in guide settings. Enabling this option has worked for me in keeping Zendesk from swapping out my completely valid code for "safer" code. 

  • Shayan Moussawi

    Is there a way to create or update content blocks via API?

  • Gabriel Manlapig
    Zendesk Customer Care
    Hi Shayan, 
    As of the moment, we do not have any way to utilize (create & update) the Content Blocks via the Guide API at this time. I can imagine, it would be incredibly helpful. 
    I would recommend you to leave Feedback in our Community. Our Teams are frequently looking through the posts in order to get ideas on future additions to the Software. The more a votes a post gets, the higher the chance that the feature will be added in the future. Thank you!
  • Simon

    When will HTML be supported in content blocks? I agree with some in that it is a blocker for us as we use a lot of custom HTML elements within our articles. 


Please sign in to leave a comment.

Powered by Zendesk