How to get started with C7 Form Builder

There are a lot of form solutions for WordPress. And why not? After printing “Hello World!”, the easiest starter plugin to make is probably some sort of contact form solution. Besides, at some point in their web design and/or development careers, everyone needs to build a form.

The typical process involves installing Contact Form 7, if you just want to send yourself some basic emails, or installing something more complex (and paid) like Gravity Forms for anything else.

Failing that, you could always roll your own. And hey, you don’t have to do that from scratch. C7 Form Builder is all about making functional forms a bit faster, and perhaps making them easier to manage. You still do it all with text (there’s no graphical form builder), but now you have an API.

Now why would you want an API for building forms? Well first of all, building a form gets as simple as this:

add_action( 'cfb_register', 'my_prefix_cfb_register_form' );
function my_prefix_cfb_register_form( $cfb ) {

        // Register all of your forms here
        $cfb->register_form( 'my_prefix_form_name', 'theme', array(
            'title'  => __( 'Form Title', 'text-domain' ),
            'fields' => array(
                // Declare as many fields as you want using the below format.
                'text_field_name' => array(
                    'type'  => 'text', // Required. One of the valid registered field type.
                    'label' => __( 'Text Field Label', 'text-domain' )
                ),
                'submit_field_name' => array(
                    'type' => 'submit'
                ),
            ),
        )
    );
}

Yeah, I stole that code straight from the documentation, but you get the idea, right? You can register forms like you would custom post types. You can treat them, and call them, like post types on the front end. You can use the forms on the back end instead. You can create meta boxes for posts, or add extra fields to user profile pages.

In short, it’s a flexible, powerful way of integrating forms into your website. If you chose to, you could even register the forms with a plugin of your own, making them mostly theme-independent.

However/if you decide to use the plugin, keep an eye on its development. There’s more to come. I’ll leave you with the complete list of features from the plugin’s page:

Features

  • Redirect to a custom WordPress page or a URL after successful submission.
  • Break large forms into tabs.
  • Inbuilt repeatable field support. Dynamically add or remove all the bundled field types excluding hidden, select and submit field types as repeatable field support is removed intentionally from them.
  • Sortable Fields – drag and drop all the repeatable fields to change the order.
  • Compatible with any CSS framework like Bootstrap, Foundation, etc.
  • Using field storage types, save form fields anywhere you want.
  • Create and register new form types, field types, form view types, field view types, and storage types.
  • Easy to extend and customize.

Available Field Types

  • Color
  • Editor
  • Email
  • Group
  • Hidden
  • Number
  • Password
  • Select
  • Submit
  • Textarea
  • Text
  • URL

Ezequiel Bruni is a web/UX designer, blogger, and aspiring photographer living in Mexico. When he's not up to his finely-chiselled ears in wire-frames and front-end code, or ranting about the same, he indulges in beer, pizza, fantasy novels, and stand-up comedy. More articles by Ezequiel Bruni
Home CSS Deals DesignBombs HTML HTML5 JavaScript jQuery Miscellaneous Mobile MySQL News PHP Resources Security Snippet Tools Tutorial Web Development Web Services WordPress