Jump to content

ProcessWire ProFields: Multiplier


ryan
 Share

Recommended Posts

Previously I posted about Textareas. The next field coming in ProFields is called Multiplier. This field lets you take almost any existing single-value Fieldtype, and use it as 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 Multiplier. Here's a short video introduction to Multiplier.

Like with the previous screencast, I recommend upping the quality to 720p and viewing full screen. This one also includes narration, though we're in allergy season here so my voice is a little rough. 

The next fields I have to tell you about in a few days are: Table, PageTable and AutoLinks. 

  • Like 27
Link to comment
Share on other sites

Is this something similar to repeaters but with the min and max inputs options added?

Similar only in the multi-value aspect. Repeaters are creating a new page for each item, and that page can have any fields. That's incredibly powerful, but also consumes a lot of resources. That's why we don't recommend repeaters in large quantities or other large scale usages. Multipliers on the other hand multiply an existing Fieldtype like Text, Textarea, Integer, Email, etc. (including those that don't yet exist), without any overhead or additional resources. They are incredibly scalable. Like all the ProFields, Multipliers are a tool that enhances things you can already do [with repeaters] by doing them more efficiently and in a more focused way. They are especially desirable those using PW for large scale projects. They may also be preferable from the admin UI aspect in that they don't have to be as flexible as repeaters, so they can stay more focused on the UI side as well. 

Just for the record: Multiplier doesn't support language text fields.

Language text fields (FieldtypeTextLanguage and FieldtypeTextareaLanguage) are multi-property fields. Multiplier can only multiply single-property fields at present (though most Fieldtypes are single-property Fieldtypes). On the core side, Multiplier can multiply: Text, Textarea, Integer, Float, Email, Datetime, Selector and URL. It can also multiply 3rd-party Fieldtypes as well (so long as they are single-property). However, it is technically possible to multiply multi-property Fieldtypes as well, so I am planning to add support for multi-property Fieldtypes in one of the next versions of Multiplier. This would enable you to multiply Fieldtypes like TextLanguage, TextareaLanguage, and MapMarker (and other 3rd party multi-property Fieldtypes). Since there are a whole lot more single-property Fieldtypes, Multiplier is focused on those for this first version. 

  • Like 6
Link to comment
Share on other sites

I am desire to build on-line menu for my restaurant Roderigo Kitchen with reward coupon. Maryla and Jeffrey handle express order as they come in so you do not need to worry that. I see this textarillos and multipliers maybe good for on-line menu? Maryla also ask can it store price and photo to customer after order of daily special? Also Roderigo meat boat special this week only. Like Japanese bento boxo but all meat no veg and in special boat customer can take home and use in tub or use to drunk margarita. Can profielders help to show customer this kind special in on-line express menu?

Thanking you,

Roderigo Sosa

  • Like 3
Link to comment
Share on other sites

Can you multiply all kinds of fields or just certain types?

You can multiply any type of field that holds a single value/property. This includes Text, Textarea, Integer, Float, Email, Datetime, Selector and URL. It can also multiply 3rd-party Fieldtypes as well (so long as they are single-property). 

  • Like 2
Link to comment
Share on other sites

  • 8 months later...

Hello,

this looks exactly like what I need for a new project. Before I go and buy ProFields I'd like to know if it fits for what I want to do.

In my case the multiplier field will be used on a frontend form.

Is it possible through the API to show a fixed number of fields, depending on the context?

Example:

I have a template for servers. Depending on the server model, each server can have different number of channels.

So I need to render a frontend form via the API that has either 4, 8, 10, 20 or 40 multipliers of the channel field depending on the server model.

Is this possible and is there some documentation on how to save/retrieve values through the API?

Thanks

Link to comment
Share on other sites

  • 4 months later...

Is it possible to search on multiplier fields using a selector? i.e.

$q = 'a search query';

$searchResults = $pages->find("textarea_multiplier%=$q");

This produces a fatal error:

Error: Exception: Operator '%=' is not implemented in FieldtypeMultiplier

Can this be done without looping over the contents of the multiplier?

Link to comment
Share on other sites

I'm not seeing the same error here. I setup a multiplier that uses "Textarea" and then populated values and did a search using the "%=" operator. It successfully located the page I put it on. Double check that your "field type to multiply" specified on the details tab for Multiplier is "Textarea". If it still doesn't work, what version PW and Multiplier are you using?

Link to comment
Share on other sites

  • 1 month later...
  • 7 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...