PHPackages                             dd/evolutioncms-plugins-managermanager-mm\_ddmultiplefields - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dd/evolutioncms-plugins-managermanager-mm\_ddmultiplefields

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dd/evolutioncms-plugins-managermanager-mm\_ddmultiplefields
===========================================================

Widget for plugin ManagerManager that allows you to add any number of fields values (TV) in one document (values are written in field as a JSON object). For example: a few images.

4.12.0(3y ago)004[4 issues](https://github.com/DivanDesign/EvolutionCMS.plugins.ManagerManager.mm_ddMultipleFields/issues)[2 PRs](https://github.com/DivanDesign/EvolutionCMS.plugins.ManagerManager.mm_ddMultipleFields/pulls)JavaScriptPHP &gt;=5.4.0

Since May 25Pushed 1y ago2 watchersCompare

[ Source](https://github.com/DivanDesign/EvolutionCMS.plugins.ManagerManager.mm_ddMultipleFields)[ Packagist](https://packagist.org/packages/dd/evolutioncms-plugins-managermanager-mm_ddmultiplefields)[ Docs](https://code.divandesign.ru/modx/mm_ddmultiplefields)[ RSS](/packages/dd-evolutioncms-plugins-managermanager-mm-ddmultiplefields/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (1)Versions (13)Used By (0)

(MODX)EvolutionCMS.plugins.ManagerManager.mm\_ddMultipleFields
==============================================================

[](#modxevolutioncmspluginsmanagermanagermm_ddmultiplefields)

Widget for plugin ManagerManager that allows you to add any number of fields values (TV) in one document (values are written in field as a JSON object). For example: a few images.

Capabilities:

- Save several images, text fields, selects, etc to a document field.
- Create several columns with different (or identical) data types. For example: images with titles (`$params->columns`).
- Number of rows may be fixed, dynamic or may lay in the special range (`$params->minRowsNumber`, `$params->maxRowsNumber`).
- Rows sorting by drag and drop.
- Generating of an unique ID for each row.
- List of predefined values for a column (`$params->columns[i]['type']` == `'select'`).

Requires
--------

[](#requires)

- PHP &gt;= 5.4
- [(MODX)EvolutionCMS.plugins.ManagerManager](https://code.divandesign.ru/modx/managermanager) &gt;= 0.7

Installation
------------

[](#installation)

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

You may also read this documentation:

- [(MODX)EvolutionCMS.plugins.ManagerManager](https://code.divandesign.ru/modx/managermanager).
- [(MODX)EvolutionCMS.modules.ddMMEditor](https://code.divandesign.ru/modx/ddmmeditor).
- [(MODX)EvolutionCMS.snippets.ddGetMultipleField](https://code.divandesign.ru/modx/ddgetmultiplefield).

Type of TV must be `textarea`.

Parameters description
----------------------

[](#parameters-description)

- `$params`

    - Desctription: Parameters, the pass-by-name style is used.
    - Valid values:
        - `stdClass`
        - `arrayAssociative`
    - **Required**
- `$params->fields`

    - Desctription: Names of TV for which the widget is applying.
    - Valid values: `stringCommaSeparated`
    - **Required**
- `$params->columns`

    - Desctription: Columns.
    - Valid values: `array`
    - Default value: `[ ['type' => 'text'] ]`
- `$params->columns[i]`

    - Desctription: Column.
    - Valid values: `arrayAssociative`
    - **Required**
- `$params->columns[i]['type']`

    - Desctription: Column type.
    - Valid values:
        - `'text'` — `` column
        - `'textarea'` — `` column
        - `'richtext'` — column with rich text editor
        - `'image'` — image column
        - `'file'` — file column
        - `'date'` — date column
        - `'select'` — `` column (see `$params->columns[i]['data']`)
    - **Required**
- `$params->columns[i]['title']`

    - Desctription: Column title.
    - Valid values: `string`
    - Default value: `''`
- `$params->columns[i]['alias']`

    - Desctription: An unique column alias. If empty, just numeric index will be used.
    - Valid values: `string`
    - Default value: —
- `$params->columns[i]['width']`

    - Desctription: Column width, px.
    - Valid values: `integer`
    - Default value: `180`
- `$params->columns[i]['data']`

    - Desctription: Valid values (for the `'select'` column type)
    - Valid values: `stringJsonArray`
    - Default value: —
- `$params->columns[i]['data'][i]`

    - Desctription: Item.
    - Valid values: `arrayAssociative`
    - **Required**
- `$params->columns[i]['data'][i]['value']`

    - Desctription: Item value.
    - Valid values: `string`
    - **Required**
- `$params->columns[i]['data'][i]['title']`

    - Desctription: Item title.
    - Valid values: `string`
    - Default value: == `$params->columns[i]['data'][i]['value']`
- `$params->columns[i]['defaultValue']`

    - Desctription: Column default value.
        For now it is used only to check when deleting empty rows.
    - Valid values: `string`
    - Default value: `''`
- `$params->minRowsNumber`

    - Desctription: Minimum number of rows.
    - Valid values: `integer`
    - Default value: `0`
- `$params->maxRowsNumber`

    - Desctription: Maximum number of rows.
    - Valid values:
        - `integer`
        - `0` — unlimited
    - Default value: `0`
- `$params->previewWidth`

    - Desctription: Maximum value of image preview width (for the `'image'` columns).
    - Valid values: `integer`
    - Default value: `300`
- `$params->previewHeight`

    - Desctription: Maximum value of image preview height (for the `'image'` columns).
    - Valid values: `integer`
    - Default value: `100`
- `$params->roles`

    - Desctription: The CMS user roles that the widget is applied to.
    - Valid values:
        - `stringCommaSeparated`
        - `''` — when this parameter is empty then widget is applied to the all roles
    - Default value: `''`
- `$params->roles[i]`

    - Desctription: CMS user role.
    - Valid values: `integer`
    - **Required**
- `$params->templates`

    - Desctription: Document templates IDs for which the widget is applying to.
    - Valid values:
        - `stringCommaSeparated`
        - `''` — empty value means the widget is applying to all templates
    - Default value: `''`
- `$params->templates[i]`

    - Desctription: Templates ID.
    - Valid values: `integer`
    - **Required**

CMS events
----------

[](#cms-events)

- `OnDocFormPrerender`
- `OnDocFormRender`

Output format
-------------

[](#output-format)

The widget saves value to a TV as JSON object with the following structure:

```
{
	"1590412453247": {
		"0": "First row, first column value",
		"customAlias": "First row, second column value"
	},
	"1590412497589": {
		"0": "Second row, first column value",
		"customAlias": "Second row, Second column value"
	}
}
```

Where:

- `1590412453247`, `1590412497589` — the unique auto generated row IDs (JS `(new Date).getTime()` is used while creating rows).
- `0`, `customAlias` — column index or alias (if set).

Rows objects with empty column values will not be saved. If all columns and all rows are empty, an empty string (`''`) will be saved instead of an empty JSON ojbect (`'{}'`).

It is strongly recommend to use [(MODX)EvolutionCMS.snippets.ddGetMultipleField](https://code.divandesign.ru/modx/ddgetmultiplefield) &gt;= 3.5 for rendering TVs on site.

Examples
--------

[](#examples)

### Make the TV `someImages` available for adding several number of images

[](#make-the-tv-someimages-available-for-adding-several-number-of-images)

Create the TV `someImages`, set it's type equal to `textarea`.

```
mm_ddMultipleFields([
	'fields' => 'someImages',
	'columns' => [
		//Only one column
		[
			'type' => 'image'
		]
	]
]);
```

### Create 2 columns: images with titles

[](#create-2-columns-images-with-titles)

```
mm_ddMultipleFields([
	'fields' => 'someImage',
	'columns' => [
		[
			'type' => 'image',
			'title' => 'Photo'
		],
		[
			'type' => 'text',
			'title' => 'Title'
		]
	]
]);
```

### Using column aliases (`$params->columns[i]['alias']`)

[](#using-column-aliases-params-columnsialias)

```
mm_ddMultipleFields([
	'fields' => 'photos',
	'columns' => [
		[
			'type' => 'image',
			'title' => 'Photo',
			'alias' => 'src'
		],
		[
			'type' => 'text',
			'title' => 'Title'
			'alias' => 'alt'
		],
		//In the same time we can use columns without aliases, numeric index will be used in this case
		[
			'type' => 'textarea'
			'title' => 'Notes'
		]
	]
]);
```

Will be save something like this:

```
{
	"1590412453247": {
		"src": "assets/images/ElonMusk.jpg",
		"alt": "Elon Reeve Musk",
		"2": "Business magnate and investor"
	},
	"1590412497589": {
		"src": "assets/images/YuryDud.jpg",
		"alt": "Yury Aleksandrovich Dud",
		"2": "Russian journalist and YouTuber"
	}
}
```

### Table of employees contacts

[](#table-of-employees-contacts)

Create the TV `employees`, set it's type equal to `textarea`.

```
mm_ddMultipleFields([
	'fields' => 'employees',
	'columns' => [
		[
			'type' => 'text',
			'title' => 'Name',
			'width' => 250
		],
		[
			'type' => 'text',
			'title' => 'Phone'
			'width' => 100
		],
		[
			'type' => 'text',
			'title' => 'Job title'
			'width' => 200
		]
	],
	//Minimum 2 employee is required
	'minRowsNumber' => 2,
	//And maximum 10
	'maxRowsNumber' => 10
]);
```

### `` column type

[](#select-column-type)

```
mm_ddMultipleFields([
	'fields' => 'employees',
	'columns' => [
		[
			'type' => 'text',
			'title' => 'Name',
			'width' => 250
		],
		[
			'type' => 'text',
			'title' => 'Phone'
			'width' => 100
		],
		[
			'type' => 'select',
			'title' => 'Job title'
			'data' => '[
				{
					"value": "Founder"
				},
				{
					"value": "SEO"
				},
				{
					"value": "Designer"
				},
				{
					"value": "Product manager"
				},
				{
					"value": "Developer"
				}
			]'
		]
	]
]);
```

Links
-----

[](#links)

- [Home page](https://code.divandesign.ru/modx/mm_ddmultiplefields)
- [Telegram chat](https://t.me/dd_code)
- [Packagist](https://packagist.org/packages/dd/evolutioncms-plugins-managermanager-mm_ddmultiplefields)
- [GitHub](https://github.com/DivanDesign/EvolutionCMS.plugins.ManagerManager.mm_ddMultipleFields)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~105 days

Recently: every ~139 days

Total

11

Last Release

1129d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/09b81986267e62b5fde1473b40aa6f11f7bc26c1c29d5f80f2768c8788e08110?d=identicon)[dd](/maintainers/dd)

---

Top Contributors

[![Ronef](https://avatars.githubusercontent.com/u/1333424?v=4)](https://github.com/Ronef "Ronef (69 commits)")[![MrSwed](https://avatars.githubusercontent.com/u/5120610?v=4)](https://github.com/MrSwed "MrSwed (2 commits)")[![deversjkee](https://avatars.githubusercontent.com/u/10138189?v=4)](https://github.com/deversjkee "deversjkee (1 commits)")[![psthmn](https://avatars.githubusercontent.com/u/1769215?v=4)](https://github.com/psthmn "psthmn (1 commits)")

---

Tags

modxMODX Evoevoevolution-cmsmodx evolutionevo cmsevolutioncmsdivandesigndd studiodd groupmmmanagermanagermm widgetmultiple fieldmm\_ddMultipleFields

### Embed Badge

![Health badge](/badges/dd-evolutioncms-plugins-managermanager-mm-ddmultiplefields/health.svg)

```
[![Health](https://phpackages.com/badges/dd-evolutioncms-plugins-managermanager-mm-ddmultiplefields/health.svg)](https://phpackages.com/packages/dd-evolutioncms-plugins-managermanager-mm-ddmultiplefields)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
