• Learn how AI and automation actually work in your Help Desk. Ask our experts how to improve team speed and customer happiness! AMA Nov 17-21.

    Ask us anything

CMS Development

bearons
Contributor

Modules Disappearing After Edits in Editor

SOLVE

Hi there,

I am developing a blog post template using a series of custom modules. It appears that if I change the value of a text field within a module, the rest of the text fields in that module disappear on the page and don't reappear until the page or module is reloaded.

 

For example, each of the fields in the blog banner in the following screenshot are editable via the HubSpot content editor. 

bearons_0-1728917544707.png

 

When I make a modification to a single one of the fields, 1-2 other fields will disappear from the screen. Below, I will change the 'Summary Text' field to add a single extra character:

bearons_1-1728917698350.png

 

You can see that the title field has completely disappeared and the subtitle field has reverted to a different date without the user making edits to that field. 

 

I am using macros to develop some of these so I'm wondering if those only fire on page load or something along those lines? What could be causing these elements to disappear/change?

 

Below is the code for my Blog Banner module:

{% macro textElementBANNER(element, class, text) %}
{% if element == "h1" %}
<h1 class="{{class}}">{{text}}</h1>
{% elif element == "h2" %}
<h2 class="{{class}}">{{text}}</h2>
{% elif element == "h3" %}
<h3 class="{{class}}">{{text}}</h3>
{% elif element == "h4" %}
<h4 class="{{class}}">{{text}}</h4>
{% elif element == "h5" %}
<h5 class="{{class}}">{{text}}</h5>
{% elif element == "h6" %}
<h6 class="{{class}}">{{text}}</h6>
{% elif element == "p" %}
<p class="{{class}}">{{text}}</p>
{% endif %}
{% endmacro %}
<section class="blog_events-post_banner dnd-section">
<div class="row-fluid">
<div class="blog_post-inner-wrapper">
{% if module.choice_module_data_type == 'blog' %}
<div class="blog_post-wrap">
<div class="post_details">
<div class="section-title">
{{ STL_macros.textElement(module.subtitle.element, "blog-banner__text blog-banner__subtitle", module.subtitle.text) }}
{{ textElementBANNER(module.title.element, "blog-banner__text blog-banner__title", content.name) }}
{% if !module.summary.enable_rich %}
{{ STL_macros.textElement(module.summary.element, "blog-banner__text blog-banner__summary", module.summary.text) }}
{% else %}
{{ module.summary.summary_rich }}
{% endif %}
{# <h2>{{ content.name }}</h2> #}
</div>
<div class="badge-wrapper">
{% if module.tag.tags == "default" %}
<div class="badge-wrapper--blogtag">
{% for tag in content.tag_list %}
<a class="badge--blogtag" href="{{ blog_tag_url(group.id, tag.slug) }}">
<p>{{ tag.name }}</p>
</a>
{% endfor %}
</div>
{% else %}
<div class="badge-wrapper--blogtag">
{% for tag in module.tag.custom_tags %}
<a class="badge--blogtag" href="{{ blog_tag_url(group.id, tag.slug) }}">
<p>{{ tag.name }}</p>
</a>
{% endfor %}
</div>
{% endif %}
</div>
{{ module.datetest}}
</div>
</div>
{% endif %}
</div>
</div>
</section>

 

0 Upvotes
2 Accepted solutions
JTBuys
Solution
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Modules Disappearing After Edits in Editor

SOLVE

@bearons, this is not related to the macros; I tested rending the content variables outside of the macro and they reverted to defualt values as well. However, I did confirmed this is related to the content variables. So, this appears to have something to do with the timing of the module refresh and its access to the global content variable.

View solution in original post

nekolove
Solution
Member

Modules Disappearing After Edits in Editor

SOLVE

Hi! @BérangèreL 

This issue occurred in the blog content.

The problem has been resolved!!

It was caused by the timing of the macro execution.

The process that tried to assign an ID to the title was the root cause.

View solution in original post

9 Replies 9
nekolove
Member

Modules Disappearing After Edits in Editor

SOLVE

@bearons @JTBuys 
Hi, I’m having the same issue just now.
How did you fix it?

0 Upvotes
BérangèreL
Community Manager
Community Manager

Modules Disappearing After Edits in Editor

SOLVE

Hi @nekolove, I hope that you are well!

Thanks for flagging this to the HubSpot Community. To help troubleshoot, could you let us know:
 

- Which editor are you using (email, landing page, website)?
- Does this happen to specific modules or any module you edit?
- Are there any error messages or warnings?

A few things to try now:


- Clear your browser cache and reload the editor.
- Try using a different browser or incognito mode.
- Check the revision history to see if you can restore the missing module.
- Double-check that your user permissions allow full editing.

Also, I'd love to put you in touch with our Top Experts: Hi @CSteinbach, @sylvain_tirreau and @Anton do you have suggestions to help @nekolove, please?

Have a lovely day and thanks so much!
Bérangère





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




nekolove
Solution
Member

Modules Disappearing After Edits in Editor

SOLVE

Hi! @BérangèreL 

This issue occurred in the blog content.

The problem has been resolved!!

It was caused by the timing of the macro execution.

The process that tried to assign an ID to the title was the root cause.

BérangèreL
Community Manager
Community Manager

Modules Disappearing After Edits in Editor

SOLVE

Hi @nekolove,
 

Thank you for sharing your update and the resolution. Your feedback helps the community and others facing similar issues.
 

If you have any other questions or insights, feel free to post.
 

Have a wonderful day! 🌞
Bérangère





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Upvotes
JTBuys
Solution
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Modules Disappearing After Edits in Editor

SOLVE

@bearons, this is not related to the macros; I tested rending the content variables outside of the macro and they reverted to defualt values as well. However, I did confirmed this is related to the content variables. So, this appears to have something to do with the timing of the module refresh and its access to the global content variable.

bearons
Contributor

Modules Disappearing After Edits in Editor

SOLVE

Hi @JTBuys , that code is the same exact code as the textElementBANNER macro listed at the top of the included code. The only difference is that the STL_macros.textElement macro exists in a separate file containing only macros that is being loaded in via an 'includes' statement at the top of the current file, as such:

{% import "/STL_Accenture_Theme_2024/templates/STL_modulepartials.html" as STL_macros %}
{{ require_css(get_asset_url('../../../css/STL_variants.css')) }}  
{% require_css %}
<style>
  .blog_events-post_banner {
    ...
  }
  ...
</style>
{% end_required_css %}

 

0 Upvotes
JTBuys
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Modules Disappearing After Edits in Editor

SOLVE

Got it, thank you! I may know what is happening. I'll test on my end and let you know.

JTBuys
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Modules Disappearing After Edits in Editor

SOLVE

@bearons, would you please also share the code for the STL_macros.textElement macro as well as your fields json?

0 Upvotes
BérangèreL
Community Manager
Community Manager

Modules Disappearing After Edits in Editor

SOLVE

Hi @bearons and welcome to the Community!
We are so glad to have you here!

Thanks for asking the Community and for sharing the code and screenshots!

I'd love to put you in touch with some of our Top Experts: Hi @Jnix284, @Anton and @ChehakWadhdwa do you have suggestions to help @bearons, please?

Thanks a lot and have a lovely day!

Best,
Bérangère





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Upvotes