CMS Development

tezrosolutions
Membre

Accessing custom text field in my HubSpot blog listing HuBL markup

Résolue

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

0 Votes
1 Solution acceptée
Ty
Solution
HubSpot Employee
HubSpot Employee

Accessing custom text field in my HubSpot blog listing HuBL markup

Résolue

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

 

 

Voir la solution dans l'envoi d'origine

0 Votes
2 Réponses
Ty
Solution
HubSpot Employee
HubSpot Employee

Accessing custom text field in my HubSpot blog listing HuBL markup

Résolue

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 Votes
amin9
Participant

Accessing custom text field in my HubSpot blog listing HuBL markup

Résolue

@Ty 

Is this code applicable now, or backdated?

0 Votes