Need to Customize Form Generated by the Forms Addon Module

b1gw0rm - 1 week ago

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.

Answer

- 1 week ago

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 {% set form = form('forms::YOUR_SLUG') ... .get() %} areas.

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

{{ form('forms::YOUR_SLUG')...|raw }}

ryanthompson - 1 week ago

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 {% set form = form('forms::YOUR_SLUG') ... .get() %} areas.

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

{{ form('forms::YOUR_SLUG')...|raw }}

ryanthompson - 1 week 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.