Prevent editing in content editors in coded HubSpot templates

Written by
Stephanie O'Gay Garcia

First Published:

May 27, 2022

Last Updated:

May 27, 2022

⚠️ Note that this post hasn't been updated for at least a year and the information may be outdated, proceed with caution! (Last updated: May 27, 2022)

In the classic "drag-and-drop" editor, there's an option you can enable at the template level that will allow you to lock the module at the page editor, so that editors can't update the content.

In a coded template, you can do the same by using the "overrideable" parameter. As the documentation specifies: the parameter "controls whether or not the module can be edited in the content editor. This parameter is the equivalent of using the lock module feature in the Template Builder UI."

As an example, you might have the following code in your blog post template to prevent editing the comments section on individual posts:

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters

{%module'blog_comments'
path='@hubspot/blog_comments',
label="Blog Comments",
overrideable=false
%}

view raw prevent_editing_in_content_editors.jinja2 hosted with ❤ by GitHub