Even thou DG3 can be used as a CMS if you are the only content editor, this is not what most users understand by the term CMS. In this document we will create the first version of a CMS storing the pages in a database.

Create a table

The first thing to do is to create the table where we are going to store the pages. Let's call the table Articles, store a title, body, id and slug. The slug is a term used for a unique name to look-up an article with a name all in lower case and without any spaces. It is good for making human readable permanent links on the web.

  1. Go to the dababase section
  2. Select new table either by right clock or icon
  3. Give the name Articles
  4. Add fields by right click in All fields browser and select New field
  5. Save
  6. Close table definition before starting use the fields added

Field definitions

Name Type Len Req Vir Prv Idx Unq Derivation
title text 255
body memo
slug text 40 X X X
id text
16 X X X X UniqueID()
createddate date X X X Current date
createdtime time X X Current time
updateddate date X X X if (updateddate = Current date , Current date , Current date )
updatedtime time X X if (updatedtime = Current time , Current time , Current time )

After table created

About derivations

Derivations are formulas that are calculated on the server for each field. You can use any of a rich set of functions and operators that are built into prism. A formula are always calculated for virtual fields, and on required fields it will be calculated on change on fields used in the derivation. When you create a new record, the default values are calculated on the server and presented in the fields.

About field types

DG3 support the most common field types used in webpages like text, numbers, date, time, choices and memo. A text can be from 1-255 chars long and memo up to 65000 chars. Numbers can be int, fixed and float of different lengths. Date and time is entered by default as the settings in your locale or the on set as default in DataEase. The internal storage format that is used is independent of the way it is entered into the database.