內容目錄
- 1 前言介紹
- 2 外掛協作開發者
- 3 外掛標籤
- 4 內容簡介
- 5 原文外掛簡介
- 6 elements. The CSS class attributes remain unchanged. email: Notify the site’s WordPress administrator (or sendto email address) that a form has been submitted by setting the email attribute to on. This will result in an email being sent to the blog administrator (or sendto email address) letting them know a form was submitted with the URL of the form along with the date and time of submission. sendto: Notify the “sendto” email address that a form has been submitted by setting the email attribute to on. This will result in an email being sent to the “sendto” letting them know a form was submitted with the URL of the form along with the date and time of submission. The email message will always be sent to the blog administrator via Bcc. spreadsheet: The full URL to the “Shared” Google Docs Spreadsheet which stores the form responses. You must be able to open this URL successfully from a browser for the link in the email to work properly. This attribute is used in conjunction with the email attribute, it has no effect when the email attribute is not turned on. unitethemehack: Off by default, this attribute should be enabled, unitethemehack='on', when using the Unite theme from Paralleus. The Unite theme manipulates the submit button(s) on a page, the result of which is a button that prevents the Google form from being submitted. Turning this attribute on enables a hack which inserts class=”noStyle” to all submit buttons, preventing Unite from mucking with them. validation: Off by default, this attribute can be enabled, validation='on', to add jQuery based form validation support using the jQuery Validate Plugin. Enabling this optional attribute will allow inline checking without form submission to Google (which also does checking for required fields). Error messages can be styled using the gform-error CSS class. captcha: Off by default, this attribute can be enabled, captcha='on', to add a simple math based CAPTCHA to the Google Form. The CAPTCHA only appears for the final submit on multi-page forms. The CAPTCHA error message can be styled using the gform-error CSS class. columns: The number of columns the form should be split into. By default the form appears in a single column the same way it is designed in Google Docs. [gform form=’https://docs.google.com/spreadsheet/viewform?hl=en_US&pli=1&formkey=ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678#gid=0′ confirm=’http://www.example.com/thankyou/’ style=’ajax’ class=’mygform’ legal=’off’ prefix=’mygform-‘ br=’on’ title=’on’ maph1h2=’on’ email=’on’ spreadsheet=’https://docs.google.com/spreadsheet/ccc?key=0AgBHWDGsX0PUdE56R1ZldXo4a0N3VTNMNEpSemdGV3c’ unitethemehack=’off’ validation=’on’ captcha=’on’ columns=’1′] License This plugin is available under the GPL license, which means that it’s free. If you use it for a commercial web site, if you appreciate my efforts or if you want to encourage me to develop and maintain it, please consider making a donation using Paypal, a secured payment solution. You just need to click the donate button on the the plugin overview page and follow the instructions. CSS Google Forms make use of 20+ CSS class definitions. By default, the WordPress Google Form plugin includes CSS declarations for all of the classes however the bulk of them are empty. The default CSS sets the font and makes the entry boxes wider. The default CSS that ships with WordPress Google Form can optionally be turned off via the WordPress Google Form settings. Customizing Google Form CSS There are two ways to customize the Google Form CSS. The WordPress Google Form plugin includes a setting to include custom CSS and a field where custom CSS can be entered. This CSS will be preserved across themes. Add custom CSS declarations to your WordPress theme. Default Google Form CSS As of 2013-12-04, the following is are the CSS classes which Google Forms make use of. The CSS below represents the default CSS provided by WordPress Google Form. These CSS definitions can be copied and pasted into your theme CSS or the WordPress Google Form custom CSS setting and changed as desired. Some of the classes are redundant to account for both the new and old style of Google Forms. /* vim: set expandtab tabstop=4 shiftwidth=4: */ /** * CSS declarations for Google Docs Forms * * These can be copied and modified to fit the needs of * a theme. By default the only change is to make all of * the fields wider than their default width and to set the * default font. */ label.gform-error, label.wpgform-error { float: right; color: red; font-weight: bold; } div.gform-captcha, div.wpgform-captcha { margin: 5px 0px 10px; display: none; } div.gform-browser-warning, div.gform-browser-error, div.wpgform-browser-warning, div.wpgform-browser-error { -webkit-border-radius: 3px; border-radius: 3px; border-width: 1px; border-style: solid; padding: 0 .6em; margin: 5px 0 15px; } div.gform-browser-warning, div.wpgform-browser-warning { background-color: #ffffe0; border-color: #e6db55; } div.gform-google-error, div.gform-browser-error, div.wpgform-google-error, div.wpgform-browser-error { background-color: #ffebe8; border-color: #cc0000; } body.ss-base-body {} div.errorbox-good {} div.ss-attribution {} div.ss-footer {} div.ss-footer-txt, div.ss-logo { display: none; } div.ss-form {} div.ss-form-container { font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; } div.ss-form-desc {} div.ss-form-entry {} div.ss-form-entry>input { background-color: #e0e0e0; font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; } div.ss-form-heading {} div.ss-item {} div.ss-legal {} div.ss-navigate {} div.ss-no-ignore-whitespace { white-space: pre-wrap; } div.ss-required-asterisk { color: red; font-weight: bold; } div.ss-scale {} div.ss-text {} form#ss-form {} h1.ss-form-title {} hr.ss-email-break {} input.ss-q-short:text { width: 300px; } label.ss-q-help { display: block; } label.ss-q-radio {} label.ss-q-title { font-weight: bold; } span.ss-powered-by {} span.ss-terms {} td.ss-gridnumber {} td.ss-gridnumbers {} td.ss-gridrow td.ss-gridrow-leftlabel td.ss-leftlabel {} td.ss-rightlabel {} td.ss-scalerow {} td.ss-scalenumber {} td.ss-scalenumbers {} textarea.ss-q-long { background-color: #e0e0e0; font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; } tr.ss-gridrow {} /** * New Google Forms CSS 2013-04-30 */ div.ss-form-container div.disclaimer { display: none; } div.ss-q-help { } div.ss-secondary-text { } /* This hides the "Never submit passwords through Google Forms." warning. */ td.ss-form-entry > div.ss-secondary-text { display: none; } div.password-warning { display: none; } div.ss-form-container li { list-style-type: none; } /* 2013-06-04: Hide "Edit this Form" link */ a.ss-edit-link { display: none; } /* 2013-06-06: Hide help text for scales */ div.aria-only-help { display: none; } /* 2013-10-30: Hide default error messages */ div.error-message { display: none; } /* 2013-10-30: Attempt to make text entry boxes a reasonable width */ input.ss-q-short, textarea.ss-q-long { width: auto; } /* 2013-11-15: CSS to support using WordPress Google form to render spreadsheets */ /** Hide the gunk that Google adds to make the table work **/ td.hd, td.headerEnd, tr.rShim, td.sortBar { display: none; width: 0px !important; padding: 0px !important; } /** Empty selector but could be used to select all of the table cells **/ tr.rShim td, tr.rShim ~ tr td { } /** Hide the "powered" and "listview" DIVs that Google adds **/ div div span.powered, div.listview { display: none; } /** Hide the "This is a required question" message **/ div.ss-form-container div.required-message { display: none; } 各版本下載點
- 7 延伸相關外掛(你可能也想知道)
前言介紹
- 這款 WordPress 外掛「Google Forms」是 2011-09-09 上架。 目前已經下架不再更新,不建議安裝使用。
- 目前有 7000 個安裝啟用數。
- 上一次更新是 2018-08-05,距離現在已有 2464 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 4.0 以上版本才可以安裝。
- 有 51 人給過評分。
- 論壇上目前有 1 個提問,問題解答率 0%
外掛協作開發者
mpwalsh8 |
外掛標籤
google | shortcode | google docs | spreadsheet | google forms |
內容簡介
這個外掛可以透過自訂文章或捷徑來獲取發佈在 Google 表單上的表格,並且移除 Google 包裝的 HTML,然後以 HTML 表單的方式嵌入你的部落格文章或頁面中。使用 Google 表單文章型別時,wpgform捷徑接受一個參數:id,這是表單的文章 ID。當使用已棄用的 gform 捷徑時,唯一必需的參數是form,其設置為 Google 表單 URL。建議但非必須,如果你不喜歡預設的 Google 文字,你也可以提供自訂的確認頁面 URL。確認頁面會取代預設的 Google 謝謝您 頁面並提供更好的 WordPress 網站整合。還有一些其他選項,請參閱文檔以瞭解更多詳情。
例如,假設你想要整合位於 https://docs.google.com/spreadsheet/viewform?hl=en_US&pli=1&formkey=ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678#gid=0(不是真實的 URL)的表單,可以在你的 WordPress 文章或頁面中使用以下捷徑:
[wpgform id='861']
[gform form='https://docs.google.com/spreadsheet/viewform?hl=en_US&pli=1&formkey=ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678#gid=0']
已棄用:使用 gform 捷徑已經被棄用,請改用 wpgform 捷徑。
目前,此外掛只支援公開發佈為「網頁」的 Google 表單。不支援私人 Google 表單。
演示
用法
隨著功能的添加,gform捷徑的使用變得越來越複雜(現在已經被棄用)。從版本 0.46 開始,第二個捷徑 wpgform 與自訂文章類型一起被引入,用於定義表單,取代了 gform 捷徑的使用。使用新的捷徑和自訂文章類型比原先gform 捷徑的複雜使用方式簡單得多。我們強烈建議使用者將使用方式遷移到新的捷徑和自訂文章類型。新功能只會添加到自訂文章類型的使用模型中。
WordPress Google 表單捷徑 wpgform 支援單一屬性。其他控制項是從自訂文章類型存儲的資訊派生出來的。
[wpgform id='
注意:在上述語法中,包含在尖括號<>內的值表示您需要用適當的值替換的字串。請勿在您的字串中包含尖括號!
id:Google 表單自訂文章類型的數字 ID。
uid:一個唯一的字串(例如'A-'),用於確保表單元素 ID 屬性在多次出現在頁面上時是唯一的。 (可選)
Google 表單已棄用的捷徑 gform 支援多個屬性,可進一步控制和自定義 Google 表單。
[gform form='
注意:在上述語法中,包含在尖括號<>內的值表示您需要用適當的值替換的字串。請勿在您的字串中包含尖括號!
form:已發佈的 Google 表單的完整 URL。你必須能夠從瀏覽器成功地打開此 URL。
confirm:確認頁面的全程 URL。
class:表單的 CSS 類。
legal:是否顯示或隱藏版權和法律文本。
br:是否顯示或隱藏表單中的斷行符號。
prefix:表單中所有元素 ID 的前綴。
suffix:表單中所有元素 ID 的後綴。
email:是否啟用表單提交時的電子郵件功能。
sendto:表單提交後的目標電子郵件地址。
style:表單提交後的頁面跳轉方式。
spreadsheet:已連結的 Google 試算表的全程 URL。
unitethemehack:是否啓用非洲主題 hack。
原文外掛簡介
Fetches a published Google Form using a WordPress custom post or shortcode, removes the Gooogle wrapper HTML and then renders it as an HTML form embedded in your blog post or page. When using Google Form post type, the wpgform shortcode accepts one parameter, id, which is the post id of the form. When using the deprecated gform shortcode, the only required parameter is form which is set to the URL to the Google Form URL. Recommended but optional, you can also provide a custom URL for a confirmation page if you don’t care for the default Google text. The confirmation page will override the default Google Thank You page and offers better integration with your WordPress site. There are a number of other options, refer to the documentation for further details.
For example, suppose you want to integrate the form at https://docs.google.com/spreadsheet/viewform?hl=en_US&pli=1&formkey=ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678#gid=0, (not a real URL) use the following shortcode in your WordPress post or page:
[wpgform id='861']
[gform form='https://docs.google.com/spreadsheet/viewform?hl=en_US&pli=1&formkey=ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678#gid=0']
Deprecated: use of the gform shortcode is deprecated – please use the wpgform shortcode.
Currently, this plugin only supports Google Forms that are “Published as a web page” and therefore public. Private Google Forms are not supported.
Demo
Usage
As features have been added, usage of the gform shortcode has grown increasing complex (the gform shortcode is now deprecated). Begining with v0.46, a second shortcode, wpgform has been introduced in conjunction with a Custom Post Type to define forms deprecating usage of the gform shortcode. Usage of the new shortcode and Custom Post Type is much, much easier than the complexities of the original gform shortcode. Users are strong encouraged to migrate usage to the new shortcode and Custom Post Type. New features will only be added to the Custom Post Type usage model.
The WordPress Google Form shortcode wpgform supports a single attribute. The rest of the controls are derived from the information stored with the Custom Post Type.
[wpgform id='
NOTE: In the above syntax, values enclosed in angle brackets , indicate a string you need to replace with an appropriate value. Do not include the angle brackets in your string!
id: The numeric id of the Google Form Custom Post Type.
uid: A unique string (e.g. ‘A-‘) used to ensure form element ID attributes are unique when a form appears on a page multiple times. (optional)
The Google Form deprecated shortcode gform supports a number of attributes that allow further control and customization of the Google Form.
[gform form='
NOTE: In the above syntax, values enclosed in angle brackets , indicate a string you need to replace with an appropriate value. Do not include the angle brackets in your string!
form: The full URL to the published Google Form. You must be able to open this URL successfully from a browser for the gform shortcode to work properly.
confirm: A full URL to the confirmation (e.g. Thanks for your submission!) page. Be default Google displays a very basic confirmation page which cannot be integrated easily with your WordPress site. The confirm attribute allows the form submission to land on a page of your choosing. It is strongly encouraged that you make use of a confirmation page. It will make the form submission process cleaner and clearer to the end user. The confirmation page will be displayed by a page redirect unless a different behavior is specified using the style attribute.
style: Specify how the custom confirmation page should be presented. Legal values for the style attribute are redirect and ajax (e.g. style=’redirect’ or style=’ajax’).
alert: A message to display upon successful form submission in a Javascript Alert box (e.g. Thanks for your submission!).
class: Google Forms are full of classes but the WordPress Google Form plugin does not bring their definitions into page when importing the form. The class attribute allows the addition of one or more CSS classes to the DIV which wraps the Google Form. To add multiple classes, simply separate the class names with spaces.
legal: By default Google Forms have a Powered by Google Docs section at the bottom of the form which includes links to Google TOS and other Google information. If you do not want to see this information as part of the form, add legal='off' to your shortcode usage. The content remains in the form, it is simply hidden from the end user using CSS.
br: For a
tag to be inserted between the form label and the input text box by setting the br attribute to on. This will result in the form label and the input box being stacked on top of one another.
prefix: Google Forms make use 20+ CSS classes. If you use multiple forms and want to style them each differently, you can add a prefix which will be added to beginning of each class name used in the Google Form.
suffix: Append a character string to the end of each form label. This can also be accomplished using CSS, refer to the CSS section.
title: By default Google Forms have title wrapped in a
tag. If you do not want to include this form title as part of the form, add title='off' to your shortcode usage. The
content is removed from the form.
maph1h2: By default Google Forms have title wrapped in a
tag. If you want the form title but not as an
element, add maph1h2='on' to your shortcode usage. The
elements will be mapped to
maph1h2: By default Google Forms have title wrapped in a