Textareas in contribution plugin

Hello,

I’m using the contribution plugin and I don’t understand why every form field is a textarea ?
How is it possible to have a simple input instead ?

The textarea tag seems to be called from _getInputComponent() in application/views/helpers/ElementInput.php itself calling formTextArea. So is this a default behaviour ?
If so, why is there a checkbox to choose “multiple lines” for contribution form elements ?

I’m quite lost here.

Thanks for your help !

You can make some of the fields in the contribution form into dropdown menus by creating controlled vocabulary for the element using the Simple Vocab plugin.

The multiple lines checkbox should be switching between a textarea and a text input. That gets filtered in ContributionPlugin.php's elementInputFilter() function.

What version of Contribution are you using (and, is it the one from RRCHNM, or one of the various forks that are available?), and what theme are you using?

I am indeed using Simple Vocab plugin to manage dropdown menus but it does not solve the problem for simple text input (to be connected with geonames API for example).

I’m using this version of the plugin : [https://github.com/omeka/plugin-Contribution]
Actually I needed to get the ‘add_input’ behaviour back to the form, so I did some changes in the code, overriding the filter function, and forgot about that…
Back to the original code, I get text inputs instead of textareas.

I’ll try to modify the filter to get the add_input functionality, without overriding the entire function

Thank you very much !

Contribution is pretty draconian about clobbering the add_input functionality. In its filter, it explicitly gets rid of it, so I don’t see a good way to work around that. I’d say that the best thing will be to comment out the line that sets it to null. That said, I don’t know if the javascript that makes that button work will be present on the public page, or whether it still works as expected on the public side.

Yes, and this behaviour seems legit to me as a public form should avoid giving the ability to add as many entries as you want. But it’s still useful in my case and I first commented out the line as you said.
I’ve come to a different solution with a new parameter with a checkbox allowing the administrator to select if a field can be repeatable or not. My solution is here : https://github.com/benjaminh/plugin-Contribution/commit/387eb994cfd6098dd7b555ec37b7b8cfac060424

Thanks again for your help