1

how are you?

I've created a ConfigEntity and there a Configuration Form with Fieldsets and Fields.

Example: enter image description here

But now I want to change this form to Vertical Tabs, like that:

enter image description here

Do you know how can I do this?

P.s. It is for the Contrib project if you want to test it is: https://www.drupal.org/project/modal_page

2

Use the vertical_tabs form element. There is an example shown in the API documentation for this form element: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21Element%21VerticalTabs.php/class/VerticalTabs

In short, instead of using nested fieldsets, create a 'vertical_tabs' form element as the container then put multiple 'details' form elements inside it. Each of the 'details' elements will serve as the container for one vertical tab. See the example in the API documentation for the exact syntax.

4

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.