Aug 17, 2022 5:23 AM - edited Aug 17, 2022 5:25 AM
Hi guys, I'm new to HubSpot.
I have a custom local module, I need to make it global.
I read this but it doesn't work for me, I don't see any more buttons in the inspector where I can convert my module
Solved! Go to Solution.
Aug 17, 2022 8:15 AM
Thanks for the solution, but I'm not using local development yet.
Therefore, I solved my problem like this: I created a new global module, copied the code there and created the necessary fields))). It wasn't difficult because my custom module has few fields, but if there were a lot of them, this method wouldn't work.
So thanks for the tips, I'll try to use them
Aug 17, 2022 7:38 AM - edited Aug 17, 2022 7:46 AM
The local dev method @Anton suggests is the way to go!
A quick note though, if you think there's a posibility that you'll need the local version again down the line, I'd save a copy of it.
There's a bug a few of us have encountered in that scenario. Quoting @Stephanie-OG who described the bug succinctly:
When you change a module's parameter from "global": true to "global": false in the meta.json file, in the editor it's no longer showing the global overlay, but when you click into it it has the "The creator of this template prevented editing this module in the content editors." message.
Don't know if that bug still exists. But it did 3 months ago and a year ago in my case.
I was able to use revision history to roll back to a pre-bug state, but that might be a pain in the **bleep** if you've made substantial changes to your module by then.
Freelance HubSpot CMS Developer
Aug 17, 2022 8:15 AM
Thanks for the tips, I'll try to use them
Aug 17, 2022 6:34 AM
Hi @OksanaR,
you can do it by modifing the meta.json file via local development
It will look something like this
{
"label": "My custom module",
"css_assets": [],
"external_js": [],
"global": false,
"help_text": "",
"host_template_types": [
"PAGE",
"BLOG_POST",
"BLOG_LISTING"
],
"js_assets": [],
"other_assets": [],
"smart_type": "NOT_SMART",
"tags": [],
"is_available_for_new_content": false
}
if you change it like this,the module will be global
"global": true,
BUT: unless you have all settings predefined as default values, you'll lose them.
best,
Anton
Aug 17, 2022 8:15 AM
Thanks for the solution, but I'm not using local development yet.
Therefore, I solved my problem like this: I created a new global module, copied the code there and created the necessary fields))). It wasn't difficult because my custom module has few fields, but if there were a lot of them, this method wouldn't work.
So thanks for the tips, I'll try to use them