CMS Development

andireuter
Participant

Make module/template options permanently available in config files such as meta.json

SOLVE

Hi,

 

I cannot find the config names of multiple options for modules and templates such as "prevent editing in content editors" or "make available in templates and pages". If I upload my changes using HubSpot CLI these settings are lost. Maybe fields.json is relevant too because the fields don't appear when the setting is lost.

0 Upvotes
1 Accepted solution
miljkovicmisa
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Make module/template options permanently available in config files such as meta.json

SOLVE

Hello @andireuter and thanks for writing.
Could you show us the fields.json file in question?
Maybe it is malformed or something.
The availablity of a module is dictated in the meta.json file and should look like this:

{
  "global" : false,
  "host_template_types" : [ "PAGE", "BLOG_POST", "BLOG_LISTING" ],
  "module_id" : 51392739382,
  "is_available_for_new_content" : true
}


As for the "prevent editing in content editors", the fields.json is responsible for this one and it should be in the object of each item specified with the "locked" title like the following:

{ {
  "id" : "96ca1a96-57d5-2aee-29bd-1572c71961de",
  "name" : "hero_text",
  "label" : "Hero text",
  "help_text" : "The text for the hero section",
  "inline_help_text" : "The text for the hero section",
  "required" : false,
  "locked" : false,
  "type" : "richtext"
} ]


Hope this helps, if you share your files I may be able to elaborate a bit more on the issue.

If my answer was helpful please mark it as a solution.

View solution in original post

2 Replies 2
webdew
Guide | Diamond Partner
Guide | Diamond Partner

Make module/template options permanently available in config files such as meta.json

SOLVE

Hi @andireuter ,

Use this code fot temlate for all time true

<!--
templateType: page
isAvailableForNewContent: true
label: Page Name
-->For Module:
{
"label": "Social follow",
"css_assets": [],
"external_js": [],
"global": false,
"host_template_types": ["PAGE", "BLOG_POST", "BLOG_LISTING"],
"js_assets": [],
"other_assets": [],
"smart_type": "NOT_SMART",
"tags": [],
"is_available_for_new_content": true
}


Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards.

0 Upvotes
miljkovicmisa
Solution
Top Contributor | Platinum Partner
Top Contributor | Platinum Partner

Make module/template options permanently available in config files such as meta.json

SOLVE

Hello @andireuter and thanks for writing.
Could you show us the fields.json file in question?
Maybe it is malformed or something.
The availablity of a module is dictated in the meta.json file and should look like this:

{
  "global" : false,
  "host_template_types" : [ "PAGE", "BLOG_POST", "BLOG_LISTING" ],
  "module_id" : 51392739382,
  "is_available_for_new_content" : true
}


As for the "prevent editing in content editors", the fields.json is responsible for this one and it should be in the object of each item specified with the "locked" title like the following:

{ {
  "id" : "96ca1a96-57d5-2aee-29bd-1572c71961de",
  "name" : "hero_text",
  "label" : "Hero text",
  "help_text" : "The text for the hero section",
  "inline_help_text" : "The text for the hero section",
  "required" : false,
  "locked" : false,
  "type" : "richtext"
} ]


Hope this helps, if you share your files I may be able to elaborate a bit more on the issue.

If my answer was helpful please mark it as a solution.