简体   繁体   English

如何在Hubspot的编码模板中添加自定义模块?

[英]How to add a custom module to coded template in Hubspot?

I'm trying to add a custom module in a coded template in Hubspot, but cannot find any documentation or answers how to do that. 我正在尝试在Hubspot的编码模板中添加自定义模块,但是找不到任何文档或答案。 Is that even possible? 那有可能吗?

Custom module: An example of a custom module can be any HTML component, I will add a simple text as example, module is called "Hello world": 自定义模块:一个自定义模块的示例可以是任何HTML组件,我将添加一个简单文本作为示例,该模块称为“ Hello world”:

<p>Hello world</p>

Coded template: For example, let's say I have a coded template like this: 编码模板:例如,假设我有一个这样的编码模板:

<html>
<head>
  <title>{{ content.html_title }}</title>
    {{ standard_header_includes }}
</head>
<body>
    <!-- I want to add custom module here, but how? -->
    {{ standard_footer_includes }}
</body>
</html>

Is there a way to add this custom module to a coded template? 有没有办法将此自定义模块添加到编码模板中?

Custom modules can be embed using HubL statements. 可以使用HubL语句嵌入自定义模块。

For example, to display custom module with the title "Hello World" you can use such code: 例如,要显示标题为“ Hello World”的自定义模块,可以使用以下代码:

<body>
    <!-- Custom module -->
    {% custom_widget "any_unique_id" widget_name='Hello World' %}

    {{ standard_footer_includes }}
</body>

Check HubL Reference for more information - https://designers.hubspot.com/docs/hubl/hubl-supported-modules 检查HubL参考以获取更多信息- https://designers.hubspot.com/docs/hubl/hubl-supported-modules

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM