Summary
I am creating a Migxdb with nested migxdb and this working perfectly. But I am trying to find a way to hide a migxdb tab when inserting item, but I am not able to find anything related to this on the documentation
Step to reproduce
This is my config file (summarized):
{
“formtabs”:[
{
“MIGX_id”:9,
“caption”:“Elemens”,
“print_before_tabs”:“0”,
“fields”:[
{
“MIGX_id”:39,
“field”:“name”,
“caption”:“Title”,
“description”:“Element title”,
“description_is_code”:“0”,
“inputTV”:“”,
“inputTVtype”:“text”,
“validation”:“required”,
“configs”:“”,
“restrictive_condition”:“”,
“display”:“”,
“sourceFrom”:“config”,
“sources”:“”,
“inputOptionValues”:“”,
“default”:“”,
“useDefaultIfEmpty”:“0”,
“pos”:1
},
{
“MIGX_id”:49,
“field”:“lexicon_key”,
“caption”:“Lexicon Key”,
“description”:“Lexicon Key”,
“description_is_code”:“0”,
“inputTV”:“”,
“inputTVtype”:“text”,
“validation”:“required”,
“configs”:“”,
“restrictive_condition”:“”,
“display”:“”,
“sourceFrom”:“config”,
“sources”:“”,
“inputOptionValues”:“”,
“default”:“”,
“useDefaultIfEmpty”:“0”,
“pos”:1
},
{
“MIGX_id”:40,
“field”:“first_year”,
“caption”:“First year”,
“description”:“First Year”,
“description_is_code”:“0”,
“inputTV”:“”,
“inputTVtype”:“”,
“validation”:“required”,
“configs”:“”,
“restrictive_condition”:“”,
“display”:“”,
“sourceFrom”:“config”,
“sources”:“”,
“inputOptionValues”:“”,
“default”:“”,
“useDefaultIfEmpty”:“2000”,
“pos”:2
},
{
“MIGX_id”:41,
“field”:“last_year”,
“caption”:“Last Year”,
“description”:“Last Year”,
“description_is_code”:“0”,
“inputTV”:“”,
“inputTVtype”:“”,
“validation”:“required”,
“configs”:“”,
“restrictive_condition”:“”,
“display”:“”,
“sourceFrom”:“config”,
“sources”:“”,
“inputOptionValues”:“”,
“default”:“”,
“useDefaultIfEmpty”:“2100”,
“pos”:3
}
],
“pos”:1
},
{
“MIGX_id”:2,
“caption”:“Dates”,
“print_before_tabs”:“0”,
“fields”:[
{
“MIGX_id”:51,
“field”:“Dates”,
“caption”:“Dates”,
“description”:“Get all dates for this Element”,
“description_is_code”:“0”,
“inputTV”:“”,
“inputTVtype”:“migxdb”,
“configs”:“elements_dates”,
“sourceFrom”:“config”,
“sources”:“”,
“inputOptionValues”:“”,
“default”:“”
}
],
“pos”:2
}
],
}
Observed behavior
When inserting an element, the “Dates” tab is also shown. This means that someone can insert dates for an element that is not yet existing in the DB and, as consequence, the id of the element will not be automatically added to the “elements_dates” table having the element id.
Expected behavior
How can I hide a tab when creating an element, and show it when editing an element?
Environment
Modx 2.7.1 with Migx 2.12.0-pl
Thanks in advance.