zoukankan      html  css  js  c++  java
  • [eZ publish] (Tranfer) Build a form use the information collector 4

    Submission confirmation template

    The submission confirmation template for the form is loaded after the user clicks the Send formbutton (and after the system has validated the information in the form- for example, if an invalid email addresses is typed into thecorresponding field, the form will reload with a warning). It acts asan acknowledgment that the site has received the form information.

    For example, suppose our form was filled in as follows:

    Application form filled

    From the collect.ini.append.phpfile, eZ Publish knows it is working with an information collectionform called “membership_application_form”. After the user clicks the Send form button, eZ Publish looks for the corresponding template in the /content/collectedinfo/design directory.

    In this case, we will use form.tpl (the template for the default eZ Publish feedback form) in that directory as a model. Our new template is placed in /extension/ezwebin/design/ezwebin/templates/content/collectedinfo/ 

    On the front-end of the site, this is what is displayed after the form is submitted:

    Submission confirmation page

    Email template for form results

    Upon form submission, we have also specified (in collect.ini.append.php) that eZ Publish send an email. This email is generated from a template named membership_application_form.tpl in this folder:

    /extension/ezwebin/design/ezwebin/templates/content/collectedinfomail/

    In this example, the existing eZ Publish feedback.tpl template can be used as a model. 

    Note the"membership_coordinator_email_address" elements, which specify therecipient email address. In this case, they are referencing theidentifier for the “membership_coordinator_email_address” attribute(the contents of which will be specified in the next section when wecreate the form object) of the Membership Application Form object.

    Up until now, we have beenconfiguring the membership application form, but we have not yetcreated the object! To do so, first click the Content structure tab of the Administration Interface.

    In our case, we will place theform directly beneath the top-level node of the Content branch;therefore, we do not have to navigate any further in the AdministrationInterface. In the Sub items window at the bottom of the page (if it is missing, click the Sub items switch underneath the main menu of tabs), select the new form class from the dropdown list, then click the Create here button.

    New Membership Application Form object

    In this example, the only fieldswith content are shown below. Since all other attributes areinformation collectors, they can be left blank.

    Object fields part 1

    Object fields part 2

    Once you are done filling in the object's contents, click the Send for publishing button.

    The form information that is sent by email is also stored in eZ Publish. It can be accessed in templates using collectedinfo fetch functions (see the technical manual for more information about fetch functions). The main way to view this information is in the Collected information interface under the Setup tab of the Administration Interface.

    From there you will see an entry for the Membership Application Form object:

    List of collected information objects

  • 相关阅读:
    Java中String.valueOf()方法的解释
    React 16.13.1开启严格模式会触发两次render
    React开发中使用react-router-dom路由最新版本V5.1.2(三)路由嵌套子路由
    React开发中使用react-router-dom路由最新版本V5.1.2(二)路由跳转及传参
    React开发中使用react-router-dom路由最新版本V5.1.2(一)基本跳转属性
    vue 开发中实现provide和inject的响应式数据监听
    VUE开发中,数据变化后,修改了绑定对象的属性值后,页面dom没有发生变化,两种方法可以重新渲染$set和$forceUpdate
    VUE开发中.sync 修饰符的作用
    VUE开发中.native 修饰符的作用
    git报错:CONFLICT (modify/delete) ,git冲突,解决项目开发中改了相同文件同一行
  • 原文地址:https://www.cnblogs.com/davidhhuan/p/1716917.html
Copyright © 2011-2022 走看看