This Fieldtype and Inputfield combination lets you take almost any existing single-value Fieldtype, and use it to a multi-value Fieldtype.

Single value Fieldtypes are those that store one piece of information at a time, for example: Text, Textarea, Integer, Float, Email, URL, etc. Any of these, and more can be multiplied with this Multiplier fieldtype. The Multiplier fieldtype lets you use a defined or variable quantity. You setup the minimum and maximum limits when defining the field. If you want a single defined quantity, then you simply set the minimum and maximum to be the same number. From the admin side, inputs in a Multiplier can optionally be drag-and-drop sorted by the user.

Multiplier is part of the ProcessWire ProFields package available from the ProcessWire Store. 

We recommend viewing full-screen and increasing the quality to 720p. This video includes narration (sound) as well. 

Example

Lets say that we are building an employee directory. For each employee, we need to support between 1 and 3 email addresses in their contact information. Typically (without Multiplier) we would create 3 separate Email fields:

  • employee_email1
  • employee_email2
  • employee_email3

Now that you've got Multiplier, you can instead accomplish this with just one field:

  • employee_emails

The resulting value is simply a WireArray of "Email" fields. This is a very simple example, but consider how much farther this could be taken in our employee directory. We can use this for the employee's phone numbers, list of locations, interests, departments, and so on.

Basically, anytime you've got a instance where you are creating multiple fields of the same type, you may find Multiplier to be a better solution. Unlike the alternative, Multiplier fields only take up 1 field in your system, and the values of the multiplier can be optionally sortable. So if an employee's primary email address changes (for example) you can simply add the new email address and drag it to the top of the list.

Full documentation is available in the ProFields support board. 

Multiplier is part of the ProcessWire ProFields package available from the ProcessWire Store. 

Comments

No comments yet. Be the first to post!

Post a Comment

Your e-mail is kept confidential and not included with your comment. Website is optional.