ShowPage
Creating views

In the previous sections we saw how to create the data model. Now we will move on to creating the user interface to that data model. The first step in this is to create views of the data tables.

In Saltcorn, a view is a specific way for a user to interact with one or more records in a specified table. Views are built of the following components:

  • View template: there are a few view templates built in and more can be defined by plug-ins. The different view templates will be covered in the next section.

  • Table: a table is chosen to which the view template is applied. View templates can in principle be applied to any table.

  • Configuration: the view template declares how it should be configured, based on the structure of the table, in a multistep dialogue. The steps may just be a series of forms, or they may also involve the drag-and-drop builder. In the forms, the configuration can require the choice of other views. For instance, the feed view template requires you to choose the underlying view which will be repeated multiple times in a feed or in columns.

To build a view, click the views option on the main menu and then click the "Add view" button. On the screen that follows, you have to provide the basic configuration of the view: give the view a name, and choose the view template and the table to which it is applied. You also have to require the role that is required to run the view. Then click the "Configure" button, and you will be taken into the configuration steps depending on the view template.

When you have gone through the configuration, you can now run the view by clicking the Run link from the main list of views above the "Add view" button.