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


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
Jake Lett is a results-driven B2B marketing consultant with 15+ years of experience helping businesses boost online visibility, generate qualified leads, and increase sales. Specializing in SEO, HubSpot, and PPC campaign management, Jake leverages proven strategies to deliver measurable growth. As a Certified Google Ads Specialist and HubSpot Developer, he is committed to driving impactful results for his clients.

Related posts

Tags:

Want to Get Email Updates of New Articles?

Join My Email Newsletter