Accessing custom text field in my HubSpot blog listing HuBL markup

SOLVE
Highlighted
Regular Contributor

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

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Community Manager
Community Manager

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

 

 

Reply
0 Upvotes
1 Reply 1
Community Manager
Community Manager

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

 

 

Reply
0 Upvotes