CMS Development

mbaxter91288
Participant | Elite Partner
Participant | Elite Partner

Theme variables disappear

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?

0 Upvotes
4 Replies 4
mbaxter91288
Participant | Elite Partner
Participant | Elite Partner

Theme variables disappear

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.

webdew
Guide | Diamond Partner
Guide | Diamond Partner

Theme variables disappear

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.

0 Upvotes
mbaxter91288
Participant | Elite Partner
Participant | Elite Partner

Theme variables disappear

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

0 Upvotes
mbaxter91288
Participant | Elite Partner
Participant | Elite Partner

Theme variables disappear

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?

0 Upvotes