Skip to content
Home » Documentation » Controller Fields for Contact Form 7 » Frequently Asked Questions

Frequently Asked Questions

An FAQ to address questions regarding the Controller Fields for Contact Form 7 WordPress plugin.

Can I hide or display any content on the webpage using a controller field?

Yes! If you want content outside of your form to also hide or display, you just need the necessary attributes on the wrapping HTML element and the JavaScript I’ve written will still hide and display it when the user interacts with that controller form field.

Can I make it so my hidden elements animate instead of just appearing?

Yes! The CSS for a hidden form element is simple and minimalist so developers can easily override it to suit their needs. The CSS that is injected by this plugin is simply .au-cf7-hidden-by-controller { display: none;} and the JavaScript just removes or adds that class when it is displayed or hidden, respectively.

You can style all hidden data with this CSS to set it up so that it will animate to a collapsed state when it closes:
[data-controller] { display block; height: auto; max-height: 500px; overflow: hidden; transition: max-height linear 0.3s; }

And then override the plugin style for when it’s hidden to this to actually close it:
[data-controller].au-cf7-hidden-by-controller { display: block; max-height: 0; }

Is this compatible with assistive technologies?

Yes! Controller fields include the aria-expanded attributes and they are updated to true or false as the user changes its state. This attribute indicates to assistive technologies like screen readers whether the controlled elements are expanded (visible) or collapsed (hidden).

Click here to learn more about the aria-expanded attribute in accordance with W3C guidelines.

Related Post Module Attributes Before

array(29) {
  ["post_type"]=>
  string(4) "post"
  ["post_id"]=>
  string(1) "0"
  ["exclude"]=>
  string(1) "0"
  ["title"]=>
  string(32) "Related Articles & Tutorials"
  ["description"]=>
  string(0) ""
  ["max"]=>
  string(1) "3"
  ["post_ids"]=>
  string(0) ""
  ["exclude_ids"]=>
  string(0) ""
  ["is_series"]=>
  string(0) ""
  ["featured_term"]=>
  string(2) "72"
  ["exclude_terms"]=>
  string(0) ""
  ["exclusive"]=>
  string(1) "1"
  ["order"]=>
  string(4) "DESC"
  ["show_image"]=>
  string(2) "on"
  ["image_size"]=>
  string(6) "medium"
  ["menu_order_label"]=>
  string(0) ""
  ["show_order_label"]=>
  string(2) "on"
  ["show_date"]=>
  string(2) "on"
  ["show_meta_keys"]=>
  string(2) "on"
  ["show_modified"]=>
  string(0) ""
  ["show_author"]=>
  string(0) ""
  ["show_categories"]=>
  string(0) ""
  ["show_primary_category"]=>
  string(0) ""
  ["show_description"]=>
  string(0) ""
  ["show_reading_time"]=>
  string(2) "on"
  ["show_cta"]=>
  string(2) "on"
  ["cta"]=>
  string(9) "Read more"
  ["autoplay"]=>
  string(0) ""
  ["allow_sticky"]=>
  string(0) ""
}

Related Post Module Attributes

array(29) {
  ["post_type"]=>
  string(4) "post"
  ["post_id"]=>
  string(1) "0"
  ["exclude"]=>
  string(1) "0"
  ["title"]=>
  string(32) "Related Articles & Tutorials"
  ["description"]=>
  string(0) ""
  ["max"]=>
  string(1) "3"
  ["post_ids"]=>
  string(0) ""
  ["exclude_ids"]=>
  string(0) ""
  ["is_series"]=>
  string(0) ""
  ["featured_term"]=>
  string(2) "72"
  ["exclude_terms"]=>
  string(0) ""
  ["exclusive"]=>
  string(1) "1"
  ["order"]=>
  string(4) "DESC"
  ["show_image"]=>
  string(2) "on"
  ["image_size"]=>
  string(6) "medium"
  ["menu_order_label"]=>
  string(0) ""
  ["show_order_label"]=>
  string(2) "on"
  ["show_date"]=>
  string(2) "on"
  ["show_meta_keys"]=>
  string(2) "on"
  ["show_modified"]=>
  string(0) ""
  ["show_author"]=>
  string(0) ""
  ["show_categories"]=>
  string(0) ""
  ["show_primary_category"]=>
  string(0) ""
  ["show_description"]=>
  string(0) ""
  ["show_reading_time"]=>
  string(2) "on"
  ["show_cta"]=>
  string(2) "on"
  ["cta"]=>
  string(9) "Read more"
  ["autoplay"]=>
  string(0) ""
  ["allow_sticky"]=>
  string(0) ""
}