0

In Drupal 8, I have created an entity reference to an "author" taxonomy on a content type. The form display settings are set to autocomplete. By default it starts with one field and you can click "Add another item" to add more. Yet usually we are adding content with multiple authors, so to make the form more user-friendly, would it be possible to start with four fields by default?

To add clarity to the question, the field currently starts like this by default: Default starting condition for the field

I want it to start like this: Desired default starting condition for the field

Any suggestions?

0

You can enter the default values in your Field settings which is useful is you often need to enter the same combination of authors.

This will display the default values in their own "rows".

But it may be counterproductive if there are no commonly used combinations in your case.

You could limit the field to a certain number of values instead of Unlimited. Then the form element would display the exact number of input fields. This can work if the number of values you need to enter will never exceed some number.

If this is also not acceptable you can use a different widget completely: instead of Autocomplete use Select list or Check boxes/radio buttons. You can change that on the Manage form display page for the content type.

Other than that you can modify the deafault look of your widget through your theme with some custom code.

  • Thanks for the brainstorming @prkos. Sadly, the number of authors varies and there are no commonly used combinations. It sounds like we may have to go the route of custom code to modify the default state of the widget. Much appreciated! – White Fish Mar 14 at 16:22
0

Try Unlimited fields settings module may help you.

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.