Difficulty Level: Advanced. This post assumes a strong understanding of HubSpot tools and technical knowledge. Insutructions are given as guidelines and may require additional customisation.
Last Updated: October 24, 2019
Sometimes you may wish to remove the wrapper that appears around a field you create in a HubSpot custom module.
For example, it you create a Rich Text field called "Description", you can add it to your custom module using this snippet:
{% raw %}{% inline_rich_text field="description" value="{{ module.description }}" %}
like this:
However, if you inspect the output, you'll see that it's wrapped it using some of HubSpot's markup, highlighted in bold below:
<div id="hs_cos_wrapper_module_14800269481_" class="hs_cos_wrapper hs_cos_wrapper_widget hs_cos_wrapper_type_inline_rich_text" style="" data-hs-cos-general-type="widget" data-hs-cos-type="inline_rich_text" data-hs-cos-field="description"><p>A short description of your product or service.</p></div>
If you just want to display the <p>
element, you have one of two options:
Hover over the field, click on Actions and click on "Copy value only".
This will look something like the following snippet which you can use in your custom module:
{{ module.description }}
You can also update your snippet above by adding in the no_wrapper HubL parameter, like this:
{% inline_rich_text field="description" value="{{ module.description }}", no_wrapper=True %}
Written by: Stephanie O'Gay Garcia
Last Updated: October 24, 2019
I'd appreciate if you could take a moment to let me know how I can improve this article.
Hi! 👋 I'm a freelance HubSpot Website Developer based in Toronto (Canada). Give me a shout if you have questions about this post or there's anything I can help you with.
HubSpot is a full suite of Marketing, Sales and Services tools. Learn more here.
Note: as a HubSpot affiliate I will earn commission if you decide HubSpot's the right software for you! :)