Skip to main content

Custom fields

Custom fields add structured metadata to downloads. They use the same field machinery the Resource Manager and User Field system use, so the eight standard field types are available out of the box.

Where to manage fields

SurfacePath
ListAdminCP > [MC] Downloads Manager > Fields
Edit one fieldAdminCP > [MC] Downloads Manager > Fields > (edit)
Attach to a categoryAdminCP > [MC] Downloads Manager > Categories > (edit) > Fields

Field types

TypeStoresRenders as
TextboxstringSingle-line input.
TextareastringMulti-line input.
BBCodestringBBCode editor.
SelectstringDropdown.
RadiostringRadio buttons.
CheckboxarrayMulti-checkbox.
Multi-selectstringMulti-select dropdown.
Starsint1 to 5 (or 1 to 10) star widget.

Match types

Beyond the type, each field has a Match type that adds validation. Match types apply to the text-bearing types (Textbox, Textarea, BBCode):

Match typeValidates
NoneNo extra validation.
NumberInteger or decimal.
URLURL syntax.
EmailEmail syntax.
DateParseable date.
RegexCustom regex (set the regex in Match parameters).
CallbackCustom PHP callback (set the callback class and method in Match parameters).

Creating a field

  1. Navigate to AdminCP > [MC] Downloads Manager > Fields.
  2. Click Add field.
  3. Pick a field ID. IDs are short, lowercase, alphanumeric. Example: compatibility_version.
  4. Choose a type and a match type.
  5. Set the title and description.
  6. Set whether the field is required, the maximum length, the default value, and the display order.
  7. For Select, Radio, Checkbox, or Multi-select: provide the choices, one per line.
  8. Click Save.

Attaching a field to a category

Fields are not attached globally; each category opts in to the fields it wants.

  1. Edit the category.
  2. Open the Fields tab.
  3. Tick the fields that should appear in this category.
  4. Optionally mark each as required for this category.
  5. Click Save.

Where fields render

SurfaceWhen
Upload formWhen the author creates or edits a download.
View pageBelow the description, in a custom location, or in the sidebar (depending on the field's display group).
ListingOptional, per field. Fields marked "Show in listing" appear in the category listing.

Display groups

Each field has a Display group ("Info", "Details", or "Extra"). The download view groups fields by display group when rendering.

Deleting a field

Deleting a field removes it from every download that was using it. There is no soft-delete for fields and the operation cannot be undone. Be sure before you click Delete.

Renaming a field

Field IDs are immutable. To "rename", create a new field with the new ID, copy values from the old to the new, then delete the old field.

Review fields

Reviews have their own parallel custom-field system. Manage them at AdminCP > [MC] Downloads Manager > Review fields. The same field types and match types apply.