Is it possible to copy a group of fields from one modue to another?
I'm aware you can clone modules, but I would like to be able to copy over a complicated set of fields that I've created in one module to a number of exisiting ones.
Alternatively is there a way of having some kind of global include that can be shared amongst modules?
It would be ideal if there was a way to copy/paste the JSON from one module to another in the HubSpot Design Manager. I like to have a consistent set of style settings across each module within a theme. Having to hand code them in for every module or use an external IDE is tedious.
So there is no "quick" way to do this but there are options!
First if you're looking for a global implemetation of custom property selections from a module that can be used throughout a page or theme, you can use my favorite HS property "export_to_template_context".
This property is added to module expression when coding it into a template:
You can then use the properties exported from the module by name like:
{{ widget_data.job_title.body.value }}
Second (as @SteveHTM has mentioned) you could use the "copy JSON" option from the module and paste it into another when developing locally:
When in the design manager, click Actions > Copy JSON. This code can now be pasted into a module's fields.json config file using a coded editor like VSCode. This JSON is also availble from the original module's fields.json files as well.