I am coding a custom email template that I want to have a dynamic hero image that adjust to screen size but is still editable via the hubspot UI.
I am wanting to have the header module to include customizable values where fields like background-image src, padding, background-size, etc. can have different values set for mobile vs. desktop. The module is working fine on desktop and adjust well with static values for overrides, but I cannot figure out how to get the mobile field values to export to the larger template to make the mobile overrides customizable.
I have tried using the export_to_template_context true and content.widgets as outlined in this document but I still cannot access the field values outside of the module. I ended up not adding the export_to_template_context true to the module as the documentation said it wasn’t necessary for custom modules and it stopped the module from displaying.
Current HTML configuration (just the relevant snippets):
Hey @NWombwell6 - thanks for posting in the Community!
Checking in to see if @MichaelMa’s reply provides any support to your inquiry.
Shane, Senior Community Moderator
Hey @NWombwell6,
very good point. {% require_css %}, {% require_head %}… and such def. do not work with drag&drop emails, but since you’re creating an HTML template it might work.
If this shouldn’t work, you can create a second module which contains just the CSS part and put it in the <head>-tag. Of course, you could technically add the plain css to the head and work with widget_data, but from my experience, a custom module is easier for you and the content editor to handle