-
- What is DG3
- The different components
- Requirements for running DG3
- Installation of DG3
- Additional installation steps
- Select which web server to use
- Hello World application
- Intro to CMS
- Setting up DG3 as a CMS
- Editing pages
- More about pages and urls
- Structuring a page using the grid
- Adding menu to pages
- Add images to the application
- More formating
- Sending email from contact us
- Adding menu to template
- Deploy the web site
- Storing the pages in database
- Create record
- Auto fill field
- Field validation
- Enable save button validator
- Add new button to template
- View document
- List documents
- Fix selection in menus in template
- CRUD Create Read Update Delete
- Intro to blogs
- Add user authentication
- Bootstrap authentication
- Let user change their passords
- Add reset password
- Login dialog box
- Extending the CMS to a blog
- Extend table for blogging
- Edit blog entry
- View blog entry
- User registration
- User password validation
- User field validation
- User auto login
- User extra registration fields
Storing the pages in database
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.
- Go to the dababase section
- Select new table either by right clock or icon
- Give the name Articles
- Add fields by right click in All fields browser and select New field
- Save
- 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.