[WordPress] 外掛分享: Data Source for Contact Form 7

WordPress 外掛 Data Source for Contact Form 7 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Data Source for Contact Form 7」是 2021-03-30 上架。
  • 目前有 400 個安裝啟用數。
  • 上一次更新是 2025-04-13,距離現在已有 21 天。
  • 外掛最低要求 WordPress 3.0.5 以上版本才可以安裝。
  • 有 9 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

codepeople |

外掛標籤

cf7 | csv | database | data source | contact form 7 |

內容簡介

Contact Form 7 外掛的數據來源允許填充「Contact Form 7」字段(文本、電子郵件、URL、下拉菜單,等等)與存儲在外部數據來源中的數據匹配,如數據庫、CSV 文件、URL 參數、用戶信息,帖子數據、分類,高級自定義字段(ACF)和 JSON 對象。

Contact Form 7 的數據來源包括兩個新控件:記錄集和記錄集字段鏈接。 「記錄集」控制從外部數據源(數據庫、CSV 文件或任何其他支持的數據源)讀取信息,「記錄集字段鏈接」控制用於鏈接記錄集和表單字段,以填充它們與記錄集數據。

表單中可以包含多個「記錄集」字段,可以將多個「記錄集字段鏈接」控件鏈接到同一記錄集中。

如何創建最簡單的表單,請參考我們的實用示例。

該插件還在控件欄中包括其他補充控件,除了「記錄集」和「記錄集字段鏈接」。包括「打印表單」按鈕,用於打印窗體區域,「數據表格」控制添加一個帶有記錄集記錄的進階表格,「復製到剪貼板」功能可將字段的值複製到剪貼板中,以及「下拉菜單搜索框」功能使得在長的下拉菜單中選擇變得簡單。

特點:

設置對 Contact Form 7 字段可用的外部數據源的信息。
易於使用,包括兩個新控件,用於定義紀錄集和鏈接字段。
包括「URL 參數」數據源,以使用 URL 參數的值填充表單字段。
包括「用戶信息」數據源,以用用戶信息填充表單字段。
包括「帖子信息」數據源,以特殊的帖子數據、頁面和自定義帖子類型(例如 WooCommerce 產品)填充表單字段。
包括「分類」數據源,以分類、帖子標籤或任何其他自定義分類填充表單字段。
包括「數據庫」數據源以使用數據庫中的信息填充表單字段。允許定義複雜的查詢。
允許使用字段值過濾記錄集記錄。
「補充控件」插件包括其他控件和功能,例如「打印表單」按鈕,將搜索框添加到下拉菜單中,複製到剪貼板功能和數據表格,以顯示數據源記錄。

高級版特點:

該插件具有免費版的所有特點。
包括「統計信息」數據來源,估算,圖表和圖表數據。

原文外掛簡介

Data Source for Contact Form 7 plugin allows populating the “Contact Form 7” fields (text, email, URL, drop-down menu, …) with data stored in external data sources, like a database, CSV file, URL parameters, users information, post data, taxonomies, Advanced Custom Fields (ACF) – Secured Custom Fields, and JSON objects.
Data Source for Contact Form 7 includes two new controls in the controls bar of Contact Form 7, recordset and recordset field link. The “recordset” control reads the information from the external data source (a database, a CSV file, or any other data source supported), and the “recordset field link” control for linking the recordsets and form fields to populate them with the recordset data.
A form can include several “recordset” fields, and it is possible to link multiple “recordset field link” controls to the same recordset.

The new SQL-Generator module. It generates the database queries in a more conversational style. Just describe the information needed, and get the DB query without any prior database knowledge.

How to create the simplest contact form from our practical examples.

The plugin includes other complementary controls in the controls bar in addition to the “recordset” and “recordset field link”. The “Print Form” button for printing the form area, “Data Table” control for inserting an advanced table with the recordset records, “copy to clipboard” functionality for copying the values of the fields into the clipboard, and the “Search box in dropdown menu” functionality to make easy the selection in long dropdown menus.
Features:

Set the information of external data sources available for the Contact Form 7 fields.
Easy to use, includes two new controls in the controls bar to define the recordsets and the link fields.
Includes the “URL Parameters” data source to populate the form’s fields with the values of the URL parameters.
Includes the “Users Information” data source to populate the form’s fields with the users’ information.
Includes the “Posts Information” data source to populate the form’s fields with the posts’ data, pages, and custom post types (like the WooCommerce products).
Includes the “Taxonomy” data source to populate the form’s fields with taxonomy terms, like categories, posts tags, or any other custom taxonomy.
Includes the “Database” data source to populate the form’s fields with the information of a database. Allow defining even complex queries.
SQL Generator module. It generates the database queries in a more conversational style.
Includes the “Javascript Function” data source to populate the form’s fields with the information returned from a Javascript function.
Allows using the fields’ values for filtering the recordset records.
Complementary Controls add-on. Includes additional controls and functionalities, such as the “Print Form” button, the addition of the search box to the drop-down menu, copy to clipboard functionality, and Data Table to display the data source records.

Features in Premium version:

All features of the free version of the plugin.
Includes the “Advanced Custom Fields (ACF) – Secured Custom Fields” data source to fill the form filds with data stored in the Advanced Custom Fields or Secured Custom Fields in post, users, comments, taxonomies, widgets, and options.
Includes the “CSV” data source to populate the form’s fields with the data store into a CSV file.
Includes the “JSON” data source to populate the form’s fields with the data store into a JSON file. There are hundreds of services whose outputs are JSON objects.
PDF Generator add-on. It generates PDF files with the information collected by the form and attaches them to the notification emails (Supports the “Conditional Fields for Contact Form 7” plugin tags in the PDF file content if the “Conditional Fields for Contact Form 7” plugin is installed on the website).
Post Generator add-on. It generates new posts (posts, pages, or any custom post) with the information collected by the form.
User Registration add-on to convert contact forms into user registration forms.
CSV Generator add-on to populate a CSV file with the information collected by the form.
JSON Generator add-on to populate a JSON file with the information collected by the form.
Server Side add-on to implement server side functions to call from the Recordset controls and get the list of records.

Data Source Fields
Data Source for Contact Form 7 includes two new controls in the controls bar of Contact Form 7, recordset and recordset field link.
The recordset control reads the information from the external data source and makes it available on the form. A recordset field can read one or many records from the data source.
To insert a recordset field in the form, press the “recordset” button in the controls bar. This action opens a dialog to define the recordset.
The insertion dialog includes common attributes for all data sources and specific attributes for the data source selected.
The “recordset field link” control links a recordset field to other fields in the form to populate them with the recordset data.
To insert a link field in the form, press the “recordset field link” button in the controls bar. This action opens a dialog to define the relationship between a recordset and a form’s field.
The link dialog includes the attributes to define the relationship between the recordset field and the form’s fields.
Cases of Use
Get the information of the registered user and populate the form fields for his name and email:

[cf7-recordset id="cf7-recordset-434" type="user" attributes="first_name, user_email" logged="1"]

[cf7-link-field recordset="cf7-recordset-434" field="your-name" value="first_name"]

[cf7-link-field recordset="cf7-recordset-434" field="your-email" value="user_email"]

[submit "Submit"]

Filling a plain text in the form with the first name and last name of the logged user:

[cf7-recordset id="cf7-recordset-434" type="user" attributes="first_name, last_name" logged="1"]

[cf7-link-field recordset="cf7-recordset-434" field="first-name" value="first_name"]

[cf7-link-field recordset="cf7-recordset-434" field="last-name" value="last_name"]

[submit "Submit"]

Populates the list of WooCommerce products and get the price of the selected one:

[cf7-recordset id="cf7-recordset-619" type="database" engine="mysql" query="SELECT ID,post_title,meta_value as price FROM {wpdb.posts} posts, {wpdb.postmeta} meta WHERE posts.post_type='product' AND posts.ID=meta.post_id AND meta.meta_key='_regular_price'"]

[cf7-link-field recordset="cf7-recordset-619" field="menu-719" value="ID" text="post_title"]

[cf7-link-field recordset="cf7-recordset-619" field="number-534" value="price" condition="record['ID']=={field.menu-719}"]

[submit "Submit"]

Using templates to create complex data structures. Displaying the title and excerpt of every published post:

{attribute.post_title}

{attribute.post_excerpt}

[cf7-recordset id="cf7-posts" type="post" attributes="post_title,post_excerpt" condition="post_status='publish' AND post_type='post'"]

[cf7-link-field recordset="cf7-posts" field="posts-list" value="{template.summary}"]

The form includes a template tag to design a complex data structure. To access the records attributes from the template, use {attribute.attribute-name} format. Ex. {attribute.post_title}
You can use the templates for the fields’ values or texts. The format for referring to templates is {template.template-id}. You should replace “template-id” with the id of the template tag. Ex. {template.summary}
[cf7-link-field recordset="cf7-posts" field="posts-list" value="{template.summary}"]

Using Javascript to Access the Recordset Data
The recordset fields trigger the “cf7-recordset” event after receiving the information from the data source, allowing you to access this information with Javascript. In this example, the recordset field reads motivational phrases from a third-party service and displays the first of them into a DIV tag on the form.

Add ons (Extensions)
Complementary Controls add-on
PDF Generator add-on
Post Generator add-on
User Registration add-on
CSV Generator add-on
JSON Generator add-on
Server Side add-on

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Data Source for Contact Form 7」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.1.0 | 1.1.1 | 1.1.2 | 1.1.3 | 1.1.4 | 1.1.5 | 1.1.6 | 1.1.7 | 1.1.8 | 1.1.9 | 1.2.0 | 1.2.1 | 1.2.2 | 1.3.0 | 1.3.1 | 1.3.2 | 1.3.3 | 1.3.4 | 1.3.5 | 1.3.6 | 1.3.7 | 1.3.8 | 1.3.9 | 1.4.0 | 1.4.1 | 1.5.0 | 1.5.1 | 1.5.2 | 1.5.3 | 1.5.4 | 1.5.5 | 1.6.0 | trunk | 1.0.26 | 1.0.27 | 1.0.28 | 1.0.29 | 1.0.30 | 1.0.31 | 1.0.32 | 1.0.33 | 1.0.34 | 1.0.35 | 1.0.36 | 1.0.37 | 1.0.38 | 1.0.39 | 1.0.40 | 1.0.41 | 1.0.42 | 1.0.43 | 1.0.44 | 1.0.45 | 1.0.46 | 1.0.47 | 1.0.48 | 1.0.49 | 1.0.50 | 1.0.51 | 1.0.52 | 1.0.53 | 1.0.54 | 1.0.55 | 1.0.56 | 1.0.57 | 1.0.58 | 1.0.59 | 1.0.60 | 1.0.61 | 1.0.62 | 1.0.63 | 1.0.64 | 1.0.65 | 1.0.66 | 1.1.10 | 1.1.11 | 1.1.12 | 1.1.13 | 1.1.14 | 1.1.15 | 1.1.16 | 1.1.17 | 1.1.18 | 1.1.19 | 1.1.20 | 1.1.21 | 1.1.22 | 1.1.23 | 1.1.24 | 1.1.25 | 1.3.10 |

延伸相關外掛(你可能也想知道)

暫無相關外掛推薦。

文章
Filter
Apply Filters
Mastodon