Content Types
This tutorial walks-through the creation of a basic contacts database of United States presidents. It will also serve as the foundation for subsequent tutorials to create a website and web app.
Watch the video above, or follow the step-by-step instructions below.
Sign In and launch Content Manager
We will create the contact database with Content Manager, so first:
Create "Tutorials" Folder
To keep things organized, we will create a folder to store everything for this project in one place.
- Click the New Menu () in the right panel's toolbar.
- Select "Folder" from the list of content types.
- Enter the Title "Tutorials".
- Click Approve.
The new Tutorials folder will appear in the left panel.
Create "President" Content Type
Now that we have a folder for the project, we can create a Content Type and define the fields we will use to store information about each president.
- Select Tutorials in the left panel.
- Click the New Menu () in the right panel's toolbar.
- Select "Content Type" from the list.
- Enter the Title "President".
Create "Number" Field
- Click the Fields' New Button ().
- Enter the Title "Number".
- Select the Field Type "Number".
- Check "Unique/Key" to indicate this field value must be unique for each president, and can be used to look up a specific president.
- Check "Show in Summary" so the Number will be displayed in the summary for each president when displayed in a list and other views.
Create "Name" Field
- Click the New Button () on the right of the Object Toolbar to add another field.
- Enter the Title "Name".
- Check "Show in Summary".
Create "Photo" Field
- Click the New Button () on the right of the Object Toolbar to add another field.
- Enter the Title "Photo".
- Select the Field Type "Image Data" from the drop-down. This will provide an image upload field control in Form View.
- Check "Show in Summary" to include a thumbnail of the photo with the Number and Name in List View and other views.
Add President Content Type Icon
We have technically already set up everything we need to for the President content type. However, we can improve how the content type is represented in webCOMAND by adding an icon.
- Click "President" at the far left of the path in the Object Toolbar to navigate back up a level to the Content Type Form View.
- Select the "Labels & Help" tab.
- Upload an image to the Icon field. The image will be used to represent the content type in Tree View on the left and other views.
- Click Approve
Add Presidents with Form View
Now that the President content type has been created, we can add a couple presidents in Form View.
- Click the "Tutorials" Folder in the Tree View on the left.
- Click the New Menu () in the right panel's toolbar.
- Select "President" from the list of content types.
- Enter president information for a president and upload a photo.
- Click Approve.
- Click the New Button () on the right of the Object Toolbar and repeat steps 4-6 for an additional president.
Import Presidents from a JSON URL
Content can also be imported from CSV and JSON files.
- Click the expand triangle to the left of the "Tutorials" Folder in the Tree View on the left.
- Click "Presidents" under the "Tutorials" Folder.
- Click the Import Button () in the Collection Bar.
- Enter the URL: http://www.webcomand.com/docs/developer_guide/tutorials/content_types/presidents.json
- Click Next
- Click Import
Conclusion
Now we have a simple database of United States presidents. We will build on this database to create a simple website publication next.