At its most basic, a website for a bookshop would simply give the contact details of the shop, so people can visit it.
However we want to provide visitors with a list of what is available. By the end of this tutorial we'll have a sophisticated e-commerce engine so they can buy online, but for this first step we'll simply create a mechanism for listing the books out on screen.
Of course, if that's all we were going to do, the quickest way would probably be to create a grid using an HTML table, and type in the details there. But we know that we'll want to use the data in more interesting ways later on, so its worth looking at handling the data 'properly' from the start.
To do this, we are going to use a Form component as a 'data feed' to store the information about each book, and then display the information on a Page. Helping to control the formatting of the information will be a Query (and its built-in Table view). All together, a schematic of the data flow looks like this:
Creating the Book Form
The Book Form will contain information about each book. To start with we'll want to store some basic information: Title, Author, Price. Later on, we'll want to add in more information, but Forms are very flexible, and don't mind being altered and won't loose any existing information as they get modified.
To add the Table to the site:
Adding fields to the Table
Before we can start adding information about each book, we need to configure the Table by telling it which fields it will have, effectively designing a questionnaire or form that we'll be filling in for each book.
Now we can tell it about the three fields we need initially: Title, Author and Price. For each field, click Add, and a popup dialog allows us to select the datatype, and give the field a name:
Below the list of fields is a box allowing the Default field to be specified. This tells the system which field to show us in a simple pick list, that we'll see when adding the books.
The Table is now fully configured, and ready for us to enter the details about the books.
Entering book data
If you want to edit an existing book entry, click on its title. You'll see the full details, with a link at the bottom to edit them.
It's worth noting that the process described below normally takes only about five minutes to complete, and if the description seems a bit long it's only because we take frequent opportunities to pause and look around as we go.