Creating Datatypes
Test Your Knowledge
TASK 1
- Create a global data type.
- Specify its title and type name as “RegisteredUsers”.
- Enter “Test” for the type namespace.
TASK 2
- Add 3 string fields to the RegisteredUsers data type and name them “FirstName”, “LastName” and “EmailAddress” accordingly.
- Add another string field and name it “About myself”.
- Set its Widget type to “TextArea”.
- Add a date field to the data type and name it “DateOfBirth”.
- Add a data reference field of the C1 Image File type and name it “Avatar”.
- Change its widget to Composite.Widgets.DataReference.DataTypesIImageFile.Selector
TASK 3
- Add a string field and name it “Country”.
- Set its Widget type to “Selector”.
- Specify the Country options for the selector: “Denmark”, “USA”, “UK”, “The Netherlands” and “Germany”.
- Save the data type.
- Make the data type available in the Content perspective.
TASK 4
- Create a web page and name it “Registration”.
- Add an input form to the web page (using the Forms Renderer add-on) and associate it with the RegisteredUsers data type.
- Set its response text to “Thank you for registering with us.”
- Make the form use the CAPTCHA.
- Save and publish the page.
TASK 5
- Add a data item to the RegisteredUsers global data type from the Content perspective.
- Open the Registration page in a web browser.
- Fill out and submit the form.