2

I'm building a Webform in Drupal 8. One section has repetitive grouped elements that could be added more than once. For instance, it's something like:

enter image description here

Where they could add more if they want. If this was a node, I'd use Paragraphs to create a bundle for the language name, writing proficiency and speaking proficiency, and they'd be able to add as many as they like. I'm not sure how to do it in the new D8 Webform module though. I know something like Webform Add More kinda works (though, it's really just hiding a preset number fieldsets until they're needed, not creating them dynamically), but I can't figure out anything else even close to that.

Should I just make a set, static number? Or is there another way? I know Webform is totally different now in D8, with YAML config files and how the data is stored; should I try to just make my own custom field in code?

3
  • Webform now supports composite elements.
    – troseman
    Commented Oct 8, 2017 at 7:09
  • Sorry, I haven't looked at this since July. Has something changed recently, or do you man the ability to make custom composite elements in code? I went with the latter, following the address field as an example, I believe. Commented Oct 8, 2017 at 13:58
  • yes, and there's more documentation around it. in the webform module, there's a sample composite in modules/examples.
    – troseman
    Commented Oct 8, 2017 at 16:46

2 Answers 2

1

If I gather correctly what you are asking then you are hitting https://www.drupal.org/node/2824714 . You need to write your own composite element, webform for now doesn't support this.

1
  • Yeah, I followed the address field field as an example to build out a new composite field. Commented Oct 8, 2017 at 13:59
0

Webform now has the way of creating Custom Composite elements from the UI that can be marked as unlimited. There are also various settings about layout, add more buttons, etc...

It's been worked on under this ticket: https://www.drupal.org/project/webform/issues/2916573

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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