Skip to content

MultiCombo Field (PRO)

Allows you to create a drop-down list of any objects, with the ability to select the fields to display and values

Settings:

combofield

Additional settings:

SettingsDescriptionDefault
Model classStandard MODX models, but you can add your own, for example, add msProduct model to combo_field_models system setting.modUser, modUserGroup, modResource, modTemplate, modChunk, modSnippet, modCategory, modContext
DisplayAvailable fields of the selected model to display in the drop-down list
ValueAvailable fields of the selected model for the value in the drop-down list
Sort fieldField for sorting.id
Sorting directionASC or DESCASC
Where conditionsAdditional conditions for sampling. JSON format

For example, we need a list of resources created by a specific user. This list should include the resource titles, with their aliases as the values.

To do this, select the model modResource, set the displayed field to pagetitle, and use alias as the value. In the conditions, specify:

php
`[{"createdby": 2}]` // 2 is the ID of the desired user.

Result:

combofield output

Output:

html
{$combofield} // alias

© PageBlocks 2019-present