Need to Customize Form Generated by the Forms Addon Module
Created 1 year ago by b1gw0rm

I'm using the Forms Addon Module and I'm having trouble finding any documentation on how to customize the way the forms shows up. The help link provides a simple tag for displaying the form {{ forms_display('contact_form') }} and that works okay. However, I need to customize the look and feel or that form to fit in better with the site design. Also, I need the "State" field to show up as a dropdown menu.

I tried to use the documentation found under Minimalistic Form with Custom Layout for the Contact Plugin but that did not seem to work with the Forms Addon Module.

I'm also wondering if there is any specific documentation for building forms using twig or Pyro specific tags that integrates directly with a stream.

Thank you.

ryanthompson  —  1 year ago Best Answer

Start by using the built in form function:

{% set form = form('forms::YOUR_SLUG') ... .get() %}

You can modify the form just like any other within those ... areas.

Also you can not do .get() and just pipe it to raw output as well.

{{ form('forms::YOUR_SLUG')...|raw }}
ryanthompson  —  1 year ago

At this point you are working the same as any other form - so any docs applicable to forms - apply here as well. The forms module just binds the form this way so you can grab it. The forms_display and get methods will be removed in the next version - I believe they are deprecated if not they should be - then removed.