dd/evolutioncms-plugins-managermanager-mm_dddependentfields

There is no license information available for the latest version (1.0.0) of this package.

The plugin allows to link 2 fields with a master-dependent relation. Dependent field will only be used (displayed) only when Master field has a specific value. Value of Dependent field will also be cleared when it is not used (hidden).

1.0.0 2024-01-04 09:55 UTC

This package is auto-updated.

Last update: 2024-11-06 06:27:30 UTC


README

The plugin allows to link 2 fields with a master-dependent relation:

  • Dependent field will only be used (displayed) only when Master field has a specific value.
  • Value of Dependent field will also be cleared when it is not used (hidden).

Requires

Installation

To install you must unzip the archive to /assets/plungins/managermanager/widgets/dependentFields/.

You may also read this documentation:

Parameters description

  • $params

    • Desctription: The object of parameters.
    • Valid values:
      • stdClass
      • arrayAssociative
    • Required
  • $params->masterFieldName

    • Desctription: The name of the document field (or TV) to be Master.
    • Valid values: string
    • Required
  • $params->masterFieldValue

    • Desctription: The value of the Master field when the Dependent field should be used.
    • Valid values: string
    • Default: null
  • $params->dependentFieldName

    • Desctription: The name of the document field (or TV) to be Dependent.
    • 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

CMS events

  • OnDocFormPrerender
  • OnDocFormRender

Examples

Make a page's publish date dependent on its publish status

mm_ddDependentFields([
	'masterFieldName' => 'published',
	'masterFieldValue' => '1',
	'dependentFieldName' => 'pub_date',
]);
  • pub_date will be visible only when published is on (== 1).
  • Value of pub_date will be cleared when published is off.

Links