Usually, when using a Scrivito app to deliver a website, most content is created directly on the pages. For this, one would use widgets to be able to edit and arrange the various page components as desired. In a context in which content is seen and treated as data, however, the demand to have it nicely displayed doesn’t exist. All that is needed are simple forms for acquiring and modifying the data.
This is where Scrivito’s flexibility and customizability come in: You can create data objects according to your structure requirements and provide a suitable editing configuration for them to enable editors to work with the data.
To illustrate this and prepare the data to be displayed by our Gatsby app later on, let’s begin with defining a simple
Product class like we did in our Displaying a Product List from a Search article. Create a folder named
Product in the “src/Objs” directory of your Scrivito app and place the following file in it: