A widget for ManagerManager plugin that allows document fields (or TVs) to become required. The widget appends a red asterisk to a field to indicate it is required, and alerts users if they save the document without completing all required fields.
- PHP >= 5.4
- (MODX)EvolutionCMS.plugins.ManagerManager >= 0.7
To install you must unzip the archive to /assets/plungins/managermanager/widgets/mm_requirefields/
.
You may also read this documentation:
-
$params
- Desctription: Parameters, the pass-by-name style is used.
- Valid values:
stdClass
arrayAssociative
- Required
-
$params->fields
- Desctription: The name(s) of the document fields (or TVs) that are required.
- Valid values:
stringCommaSeparated
array
- Required
-
$params->fields[$i]
- Desctription: The name of the document field or TV.
- Valid values:
string
- Required
-
$params->roles
- Desctription: The CMS user roles that the widget is applied to.
- Valid values:
array
stringCommaSeparated
''
— when this parameter is empty then widget is applied to the all roles
- Default value:
''
-
$params->roles[$i]
- Desctription: CMS user role ID.
- Valid values:
integer
- Required
-
$params->templates
- Desctription: Document templates IDs for which the widget is applied to.
- Valid values:
array
stringCommaSeparated
''
— empty value means the widget is applying to all templates
- Default value:
''
-
$params->templates[$i]
- Desctription: Template ID.
- Valid values:
integer
- Required
OnDocFormRender
mm_requireFields([
'fields' => 'pagetitle,pub_date'
]);