Jan 20, 2022 5:31 PM - edited Jan 20, 2022 5:33 PM
Hi there,
I am creating a theme and trying to utilize the {{ theme }} variables I set in modules. I have a much more complicated module, however, I've boiled it down to this simple code:
{{ theme|tojson }}
<p class="text-primary-2">easing: {{ module.header.enabled }} {{ theme.global.animations.timing }}</p>
Upon initial page load this is what I get:
{"font":"Playfair Display","font_set":"GOOGLE","styles":{"font-family":"'Playfair Display'","font-style":"normal","font-weight":"normal",....}}
<p class="text-primary-2">easing: false duration-200</p></div>
p.s. I've shortened the theme JSON for obvious reasons.
Now, when I update anything in the module, like updating a text field or something the module refreshes as normal, however, this is now the output:
{}
<p class="text-primary-2">easing: false </p>
As you can see, the theme object is completely empty.
Is this right? surely not? Any ideas?
Jan 24, 2022 6:10 PM
HubSpot has confirmed this is a bug. I have a support ticket open and our partner account manager has escalated to the correct team. I will update this ticket as and when I know more.
Jan 24, 2022 7:42 AM
Hi @mbaxter91288 ,
Kindly refer to this link here.
Hope this helps!
If we were able to answer your query, kindly help the community by marking it as a solution.
Thanks and Regard.
Jan 24, 2022 7:51 AM
hi @webdew ,
Thanks for taking the time to respond, however, not sure how that link helps in any way? Is there a specific section of that article that highlights something related to my query?
Thanks,
Mat
Jan 24, 2022 5:01 AM
For an update. I've just tried using the "inherited_value" field as well. So, for example, I've created a module-level "animation.easing" field and set its "inherited_value" to the theme's "theme.global.animations.easing" value.
Again, upon page load, this pulls the theme value correctly but when you change any setting and the module re-renders, the theme value is lost and it falls back to the fields default value.
This is really frustrating and sure must be a bug?