1

Is there any module that provides a way to implement a custom multiple field that enables user to enters both label and value? For instance I have a product that has a list of features, ie:

  • Color: Red
  • Size: Large

And I have another product that has completely different features, like:

  • Style: Tuxedos
  • Gender: Male

So I like to be able to make these flexible for the editor to enter as many as features as they need mentioning the labels as well.

Thank you in advance

4

Using Field Collection module must serve your purpose.

After installing the module, create a field collection with two text fields - label and value.

Now attach this field collection to a content type and set its value to unlimited.

in essence what you will have is: 1. When the form loads, you have two fields, a label and a value 2. An add more button, which when clicked will generate another set of label value pair.

Hope this helps.

  • Brilliant idea. So I am assuming there is no other module that would provide this sort of flexibility by creating one field? – Luca Oct 7 '13 at 21:35
1

If you only have two values, as in this case label and value, than Double Field could be very handy:

Double field is a small module written to provide extensions to Drupal's core Fields. By this module you can split your fields up into two separate parts.

For more values there is also the Composed Field, which:

is an implementation of core's Field UI that allows you to split a single field into as many sub-fields as you like.

To have the data serialized it makes it hard to get it for example in views to filter. In this cases I would prefer either Multifield or Field Collection.

0

There is the Multifield module, but it may not be as mature. Here is a quote about it (from the module's project page):

... seeks to provide a true compound field solution for Drupal 7. As much as I love Field collection, it still has to save actual entities, and can cause performance problems due to having to load all the referenced field collection entities on node, or parent entity load.

  • Thank you very much. It appears this is a light wave copy of Field Collection but useful if you don't have a complex structure – Luca Nov 3 '13 at 1:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.