nov 29, 2022 1:29 PM
I tried looking for references in the docs but this is all I could find about it, no other documentation, no explanation on the parameters.
{% 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 %}
I have been using widget_block for a while, and I tried to get this new module_block to work but it wouldn't. Is there any difference between using module_block, versus the traditional module @hubspot/rich_text?
Solucionado! Ir para Solução.
nov 29, 2022 3:41 PM
widget_block has been deprecated and module_block is basically just a version 2 of it. It uses the exact same code pattern as widget_block, only major difference to keep in mind is that the type_of_module will usually never change from module whereas in widget_block it would be things like rich_text or raw_html. You can read a slightly more in depth explination on that here - https://developers.hubspot.com/docs/cms/building-blocks/modules/using-modules-in-templates#block-syn...
The code you've posted is more an example of if you're accessing a custom module. You can still access default HubSpot modules with module_block same as you would with widget_block. That code would look something like this:
{% module_block module "my_rich_text_module" path="@hubspot/rich_text.module", label="Rich Text" %}
{% module_attribute "html" %}
<div>My HTML block</div>
{% end_module_attribute %}
{% end_module_block %}
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 3:41 PM
widget_block has been deprecated and module_block is basically just a version 2 of it. It uses the exact same code pattern as widget_block, only major difference to keep in mind is that the type_of_module will usually never change from module whereas in widget_block it would be things like rich_text or raw_html. You can read a slightly more in depth explination on that here - https://developers.hubspot.com/docs/cms/building-blocks/modules/using-modules-in-templates#block-syn...
The code you've posted is more an example of if you're accessing a custom module. You can still access default HubSpot modules with module_block same as you would with widget_block. That code would look something like this:
{% module_block module "my_rich_text_module" path="@hubspot/rich_text.module", label="Rich Text" %}
{% module_attribute "html" %}
<div>My HTML block</div>
{% end_module_attribute %}
{% end_module_block %}
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:24 PM
thanks for your help!