We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Nov 26, 2022 12:50 PM - edited Nov 26, 2022 12:54 PM
Hi,
I just started to learn more about hubspot after a long while. I'm trying to figure out this whole modules thing by reading the docs, and I get alot of it now. But I don't understand what this module_block thing is. The last time I used hubspot, they were using something called widget_block, and inside that, you would use something else called widget_attribute, then put your html code inside this. Nowadays, hubspot deprecated the old widget_block stuff to something called module. This is fine I guess, but I'm confused on the syntax of it. I tried reading the docs, but Im still not 100% clear on it. You can find the section of the doc im talking about here: Using modules in templates (hubspot.com)
I have a bit of confusion over module_block, which used to be "widget_block", the last time I looked into hubspot a couple of months ago. Heres some of the code they referenced in the docs under "block syntax".
{% module_block module "my_rich_text_module" path="/My Rich Text Field Module",
label="My Rich Text Field Module"
%}
{% module_attribute "rich_text_field_variable" %}
<div>My HTML block</div>
{% end_module_attribute %}
{% end_module_block %}
So for module_block, you have the unique name and some path. Here are some questions
In the docs, they mention these paragraphs. What is this "type_of_module" stuff and what does it mean?
The parameter that immediately follows module_block or widget_block(deprecated) is the type_of_module parameter.
In nearly all of our documentation you will find we use module. V2 HubSpot Modules are normal modules, like what you can create. Therefore there's no longer a need to use a different type_of_module.
While widget_block is deprecated, and you should use module_block. If inheriting a website from another developer it may contain old code using widget_block and type_of_module.
Thanks for the clarifications!
Thanks for the clarifications!
Solved! Go to Solution.
Nov 29, 2022 4:18 PM
If this answer solved your question, please mark it as the solution!
Need custom website/integration development or help optimizing HubSpot for your organization?
Schedule a consultation with us, an award-winning HubSpot Elite Partner.
Or check out our blog to get the latest in marketing, design, integration, and HubSpot knowledge.
Nov 29, 2022 4:18 PM
If this answer solved your question, please mark it as the solution!
Need custom website/integration development or help optimizing HubSpot for your organization?
Schedule a consultation with us, an award-winning HubSpot Elite Partner.
Or check out our blog to get the latest in marketing, design, integration, and HubSpot knowledge.
Nov 29, 2022 4:27 PM
thanks for clarifying! I appreciate it greatly!