CMS Development

tezrosolutions
Membro

Accessing custom text field in my HubSpot blog listing HuBL markup

resolver

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

0 Avaliação positiva
1 Solução aceita
Ty
Solução
HubSpot Employee
HubSpot Employee

Accessing custom text field in my HubSpot blog listing HuBL markup

resolver

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

 

 

Exibir solução no post original

0 Avaliação positiva
2 Respostas 2
Ty
Solução
HubSpot Employee
HubSpot Employee

Accessing custom text field in my HubSpot blog listing HuBL markup

resolver

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 Avaliação positiva
amin9
Participante

Accessing custom text field in my HubSpot blog listing HuBL markup

resolver

@Ty 

Is this code applicable now, or backdated?

0 Avaliação positiva