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

About the Author

Jake Lett is a results-driven Detroit based B2B marketing consultant with 15+ years of hands-on experience managing SEO and PPC campaigns across manufacturing, SaaS, and professional services industries. He’s a Certified Google Ads Specialist and HubSpot CMS Developer who has personally managed budgets ranging from $500 to over $10,000/month.

Jake specializes in helping small businesses and solo marketers get more from lean ad budgets—using practical strategies that drive qualified leads, not just traffic. He shares real-world lessons on his blog, YouTube channel, and in his published books on digital marketing.



Related posts

Tags:

Want to Get Email Updates of New Articles?

Join My Email Newsletter