Orchard document-create a custom form

Source: Internet
Author: User
ArticleDirectory
    • Enable the custom form Module
    • Add a new content type
    • Create a custom form part
    • View submitted custom form data
    • Export custom form data
Create a custom form

The Custom forms module is used to collect information about website visitors at the front-end. Custom forms work together with a content type, custom forms can be used to create pages or parts such as contact us and subscription. information is stored in Orchard and can be exported later.

Enable the custom form Module

The custom form module is combined with a content type to collect user input at the front end. The submitted information is stored and exported using the import-export module. Let's start using the custom form in the module section of the Management menu.

Once the module is enabled, a new "form" link will appear on the left of the navigation bar. As mentioned above, the working principle of a custom form is to create a content type-related submission form at the front end of the site.

In the admin form section, ifAdd a new custom form"After the selection, a drop-down list of the default content types that currently exist in CMS appears, A drop-down list in the next screen for the content types will show all of the default content types that exist currently in the CMS. however, let's take a look at adding a part on the right side (asidesecond zone) to ask visitors to join a mail list. The only collection information is the user's email address.

Add a new content type

To collect and save users' email addresses, we need to create a new type in Orchard. In the Admin menu, find the "content type" tag, select the "Create type" button, and name the new type 'subscribe form '.

The next page asks if you need to keep other parts to the newly created part"Subscribe form "content type,Because we want to collect users' email addresses and do not select any other options, press "save. Now we have a new content type, and we want to add"Input field".

Enter 'email 'in the name, and add and save the "input field". After that, we can customize the verification rules for the new input field and set the input type to email. you can also select other input types as needed.

In this way, we have all the materials for creating a new widget on the right. We have enabled the custom form module and created a new content type (subscribe form) to collect users' email addresses. The rest is to create a widget ).

Create a custom form part

SelectWidgetsIn the asidesecond area, find the appropriateAddButton to add a custom form part.

The rest is to adjust the settings of our new custom form part. In this example, the layer is set to 'default' and the position is set to '1 '. in this way, the parts are displayed on the top right of all pages. The settings in this example are as follows:

Save and browse the site to check for new features.

Remarks: If the input field shows the author, 'show editor for owner' is not selected in the common part of the subscribe form type to be removed '.

View submitted custom form data

In this case, a custom form is enabled, a new content type is created for the custom form, and a custom form part is added to the right of all pages. The submitted information is saved because we chose 'Save the item once the form is submitted'. Where is the data saved? There are two ways to view submitted information. The first is to select the "form" link in the "admin" menu bar:

The second is to select from the content type. For example:

Export custom form data

The rest is to export the submitted email address for publications, campaign monitoring, email distribution, and so on. The easiest way to output everything and everything in Orchard CMS is to use the import/export module. Import/Export module installed in version 1.6 by default, but it is not enabled by default. Let's enable the import/export module.

The import/export function is now available in the admin navigation bar. Select the 'export' tag at the top of the import/export option to display all available content types. to export the email list, selectSubscribe form. There are some export settings options at the bottom, the first option metadata (Metadata)Will include the definition of the content type. Select this option to easily copy content from one orchard CMS site to another orchard site. The main example is to migrate content from a development site to a production site. When importing an XML file that contains metadata and data, orchard imports the created content type metadata into the contained data.

In this example, we are only interested in exporting data, so you do not need to check the metadata option. Make sure that "draft only" is selected because the project entered on the foreground is published.

The exported XML file can be opened and edited in MS excel. the website can not only design the visitor's email address, but also save it for future export. The custom form is also a good tool for us or other types of user information collection.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.