CMS Development

ikonic_media
Participante

Custom Fields No Longer Appear Under 'Modules' On Blog Posts

resolver

I am building a new blog post template with the latest design manager. I have added several custom fields for testing and they do not appear in the 'modules' list in the sidebar as they did in the past. 

 

I am using the following Hubl to create a field:

{% choice "resource_type" label='Choose the type of resource', choices='Case Study, Webinar, Data Sheet, E-Book', export_to_template_context=True %}

 

I have followed HS design documentation and community posts:

https://designers.hubspot.com/docs/hubl/export-to-template-context

 

https://community.hubspot.com/t5/Content-Design-Questions/Accessing-custom-text-field-in-my-HubSpot-...

https://community.hubspot.com/t5/Content-Design-Questions/Adding-custom-fields-to-blog-post/m-p/7758

0 Me gusta
1 Soluciones aceptada
jestlinbaum
Solución
Participante

Custom Fields No Longer Appear Under 'Modules' On Blog Posts

resolver

I see. I added the following to the "Additional <head> Markup" box of the Main blog template:

{% image "company_logo" label='Company Logo', export_to_template_context=True %}

And put the call for the image in the Post Listing template:

{% if content.widgets.company_logo.body.src %}
<div class="logo-wrap">
<img src="{{ content.widgets.company_logo.body.src }}">
</div>
{% endif %}

 

Seems to be working as expected.

 

Ver la solución en mensaje original publicado

0 Me gusta
7 Respuestas 7
ikonic_media
Participante

Custom Fields No Longer Appear Under 'Modules' On Blog Posts

resolver

I confirmed with HubSpot support that we can no longer create custom fields on blog post templates using the 'export-to-template-context' documentation. Here is the full response from HS support:

 

"I can confirm that Hubl is no longer supported for blog post templates. Technically its like nesting a module within a module which is no longer allowed in the new Design Manager. What I might recommend trying is moving the code to the head HTML of the templates so it doesn't affect other posts like it, since creating a brand new custom module and removing that field entirely would end up messing with all data associated with that field being lost."

0 Me gusta
jestlinbaum
Solución
Participante

Custom Fields No Longer Appear Under 'Modules' On Blog Posts

resolver

I see. I added the following to the "Additional <head> Markup" box of the Main blog template:

{% image "company_logo" label='Company Logo', export_to_template_context=True %}

And put the call for the image in the Post Listing template:

{% if content.widgets.company_logo.body.src %}
<div class="logo-wrap">
<img src="{{ content.widgets.company_logo.body.src }}">
</div>
{% endif %}

 

Seems to be working as expected.

 

0 Me gusta
ikonic_media
Participante

Custom Fields No Longer Appear Under 'Modules' On Blog Posts

resolver

The key here was moving the custom field Hubl out of the "Blog Content" template and into the "Additional <head> Markup" field which is available on the drag-and-drop template interface when no other module or group is selected. 

0 Me gusta
Jsum
Asesor destacado

Custom Fields No Longer Appear Under 'Modules' On Blog Posts

resolver

@ikonic_media,

 

Are you placing your HubL snippet in your post template? Your syntax looks right. 

0 Me gusta
ikonic_media
Participante

Custom Fields No Longer Appear Under 'Modules' On Blog Posts

resolver

@Jsum

Yes, I am adding this to the top of my post template. 

0 Me gusta
Jsum
Asesor destacado

Custom Fields No Longer Appear Under 'Modules' On Blog Posts

resolver

Could you use vidyard or the like to share a screen cap video of the template and the result? I do not see a reason why this isn't working for you but I don't have access to the full picture.

0 Me gusta
jestlinbaum
Participante

Custom Fields No Longer Appear Under 'Modules' On Blog Posts

resolver

This is what I got from support:

Seems ridiculous!

 

"That's correct- Hubl Support Tags are no longer supported for use in the Blog Post Template. Essentially, it does render a nested module- a rich text module inside the blog content module- and this functionality has been deprecated. You can still render a static rich text module, but it won't be editable on the page level.

 

You can only add a new module to the a blog post in the template- for example, dragging an image module into the template itself- and not to the blog content module."

0 Me gusta