CMS Development

tezrosolutions
メンバー

Accessing custom text field in my HubSpot blog listing HuBL markup

解決

I added a custom text field in my HubSpot blog post template, how can I access it in the blog listing HuBL markup?

0 いいね!
1件の承認済みベストアンサー
Ty
解決策
HubSpot Employee
HubSpot Employee

Accessing custom text field in my HubSpot blog listing HuBL markup

解決

Hi @tezrosolutions,

 

In HubL, if you created your text field with markup that looks like this:

{% text "your_custom_modulefield" label="Your custom moudule field", export_to_template_context=True %}

Then when you go to reference it, you have 2 options, referencing into the POST, or referencing into the LISTING

 

Into the Post: 

{{ widget_data.your_custom_modulefield.value }}

Into the Listing:

{{ content.widgets.your_custom_modulefield.body.value }}

The difference of the two is when you're calling from outside the file where you actually made it (made in POST) you have to reference it as "content.widgets" and then reference it's value with "body.value".

More on referencing modules can be found here as well.

 

Hope this helps you out, let me know if you have any other questions!

-- Ty

 

 

元の投稿で解決策を見る

0 いいね!
2件の返信
Ty
解決策
HubSpot Employee
HubSpot Employee

Accessing custom text field in my HubSpot blog listing HuBL markup

解決

Hi @tezrosolutions,

 

In HubL, if you created your text field with markup that looks like this:

{% text "your_custom_modulefield" label="Your custom moudule field", export_to_template_context=True %}

Then when you go to reference it, you have 2 options, referencing into the POST, or referencing into the LISTING

 

Into the Post: 

{{ widget_data.your_custom_modulefield.value }}

Into the Listing:

{{ content.widgets.your_custom_modulefield.body.value }}

The difference of the two is when you're calling from outside the file where you actually made it (made in POST) you have to reference it as "content.widgets" and then reference it's value with "body.value".

More on referencing modules can be found here as well.

 

Hope this helps you out, let me know if you have any other questions!

-- Ty

 

 

0 いいね!
amin9
参加者

Accessing custom text field in my HubSpot blog listing HuBL markup

解決

@Ty 

Is this code applicable now, or backdated?

0 いいね!