module_block module unique name

Hi everyone :waving_hand:,

I’m switching custom modules from an old instance to a new instance.
The module_id is different from the old instance to the new instance but the name is still the same.

Because of that, the custom module cannot render properly.

I will give you some examples below.

This is the old instance

Capture d’écran 2023-05-16 à 11.56.09.png

And this is the new instance

Capture d’écran 2023-05-16 à 12.00.37.png

We can see that the module_id is different but the module just before is the same and to me, that’s why the custom module cannot render.

Do you know how to retrieve the module name of the current instance?

Thank you very much and have a nice day!

BTW, sorry for my bad English :slightly_smiling_face::france::baguette_bread:

Hi, @MaximeGourgues :waving_hand: No apologies needed. Thank you very much for posting in our community!

Hey, @Anton @Indra @JonPayne, do you have any insight here? How do you deal with this in your project work?

Thank you very much for taking a look! — Jaycee

@MaximeGourgues The name isn’t specifically tied to the module. You can just change it to whatever you want as long as it’s unique.

Okay, I will try this today! thank you for helping me :slightly_smiling_face:

Thanks for mentioning @Jaycee_Lewis

Hi @MaximeGourgues,

So, your telling you switched instance. What do you meen by that? You changed from portal?

At the bottom right of each custom module there is a embed code. Here it will automatically generate the name ‘module_XXXXXXXXXXX’. But this can be anything as @alyssamwilie.

What’s inportant is to check if the module_id is correct. Insead of the module_id you can also use the path. Check out this article: Using Modules in Templates

Moderator note: While this solution may not address the original poster’s specific situation, it could be helpful for other community members facing similar challenges.

Hello @Indra,
Yes I copied a custom module from the old client portal to the new portal.

The ID of the two modules are different but there is no render on the page.

As I said just below, I will try @alyssamwilie suggestion and yours.

If it works or not, you will have some news.

Once again thank you :slightly_smiling_face: :folded_hands:

Hey, I tried some of your solutions but I’m still stuck :disappointed_face:.

Maybe a page screenshot will help you:

These are errors highlighted in the custom module.

To me, It can be a path error, or an undefined name somewhere when I try to call that module because, inside the custom module, everything is written a good way.

I will try to share some links to the custom module to give you a more explicit example.

In the third screenshot, you will see some error messages that stuck me to display the module.

Hi @MaximeGourgues,

You have included a ‘module_id’ and ‘path’. But the path is set to a HubSpot module. So, try to remove path='@hubspot/module_type'.

I see your working locally. When importing the theme, modules or assets did you run into errors?

A custom module exist out or a few files:

  • module.html
  • module.css
  • module.js
  • meta.json
  • fields.json

If you still having issues, check if the fields.json has any value.

Hey @Indra :waving_hand:,

I removed the path but the module still did not render.

I’m actually not working locally but from the cms, and working from a ‘copy.html’.

I don’t know if it changes a lot.

If it’s too hard to understand maybe we could have a call and share my screen?

Hey @MaximeGourgues ,

In the Design Manager, in your module, can you scroll all the way down in the right sidebar to “Template Usage” and copy the exact snippet there into your template? If the ‘module_####’ bit is the same as your other modules you can change that, but nothing else. Does it render then?

Hey @alyssamwilie :waving_hand:,

I think we are in a good way.
I see no warnings or errors on the page and in the custom module.

But the custom module still does not display on the web page.

We can see the module when you open the dev tools but nothing more…

Below I will give you two screenshots with opened dev tools.

The first screenshot is what we are supposed to see.

And the second is what we see inside the new portal.

Hm, so the module is being placed now, just not showing any content. May be a dumb question - but have you made sure all of your changes to the module have been Published and have default content set in the fields?

hello @alyssamwilie,

Yes, everything is published and I have only dynamic content inside this module.
But even the box doesn’t show like the CSS and dynamic content are not recognized.

And I don’t see any error message :disappointed_face: