Use is_in_editor to Add Inline Comments and Notes Only in the HubSpot Editor [code snippet]

Download FREE HubSpot CMS Guide
Use is_in_editor to Add Inline Comments and Notes Only in the HubSpot Editor [code snippet]

As a HubSpot CMS developer, you sometimes need to add some contextual information in templates to make it easier for content editors to know where and how to edit things. Add the code below into a template to display help text only when editing the HubSpot template.

{% if is_in_editor %}  
<style>.hseditor-help {background:#FFFFE0;padding:1rem;text-align:center;}</style>
<div class="hseditor-help">
    <h4>Header - All Posts</h4>
    <p>Header - All Posts</p>
</div>
{% endif %}

Below is an example of how these editor notes will look.

is_in_editor in HubSpot CMS

Written by: Jake Lett
I share digital marketing tips and HubSpot tutorials to help marketers and business owners grow their business.


Related posts

Tags:

Want to Get Email Updates of New Articles?

Join My Email Newsletter