Islandora / documentation

Contains islandora's documentation and main issue queue.
MIT License
103 stars 71 forks source link

Conditional fields in Drupal form #1728

Open miha-pece opened 3 years ago

miha-pece commented 3 years ago

It would be nice if we would have option for conditional fields in form for adding repository items. For example, you have two radio button options, Add person as literal string and Link agent. Depending on selection, appropriate fields would pop-up on form.

I found one example on Drupal site: link

kspurgin commented 3 years ago

In Islandora Tech call we discussed that this may be related to what is being discussed in this issue: https://github.com/Islandora/documentation/issues/1659

miha-pece commented 3 years ago

It might be related. In a sense that universal solution for implementing conditional fields and conditional labels would be preferable. I just don't know if that is possible.

mjordan commented 3 years ago

@miha-pece also at today's Tech Call we decided to point out that there is a Drupal module (https://www.drupal.org/project/conditional_fields) that allows site builders to do the kind of things you are asking for without any coding/API. So while it is technically possible to configure conditional form fields similar to what you are describing, we came to the conclusion that providing a default Islandora configuration for conditional form fields is complicated because so many of the fields provided by default in Islandora are optional.

Would you mind providing some additional specific examples of what you would be looking for? The more information you can provide, the better.

miha-pece commented 3 years ago

A also found Drupal option, so yes, question is only if this could be useful if included as default Islandora. Maybe as example, how is possible to address some user interaction options. But I understand problems designing universal, general form, too many options could be confusing.

Our use case (at the moment as idea) is mixed fields for agents as strings or as minted agents. We think that mixed approach in one collection could be the best approach, because we have two categories of persons: on one side very stable group of persons with repeatable appearances, and on the other, many random passers, usually without sufficient personal data. Because of that, we thought that a mix approach with minted persons and open text field would be the most appropriate.