define… function.
Declare a view with defineView
A view is a saved way of looking at one object.
Views are optional. An object with none gets a plain table of its first fields. Declare views to choose the columns, add a board or a calendar, and mark one
isDefault so that people land on it.
Declare a layout with defineLayout
A layout arranges a record’s page. It has ashell (tabs, column or split) and the blocks inside it.
Blocks come from two places. Devias ships blocks for the common things: a record’s fields, related records, comments, activity and tasks. A module’s studio code can add more: see Blocks. If an object has no layout, Devias draws a default. Add a layout when a record page needs more, such as a second tab for the deals that belong to a company.
Declare navigation items with defineNavItem
Nav items are the rows of the sidebar. Each has a label, an icon and a target.groupmakes a heading that holds other items, linked byparentId.objectopens an object, optionally on a given view.pageopens a page that the module’s studio code provides.urlopens a link, optionally in a new tab.
position to order items among others. People can still rename, hide and rearrange them in Settings → Navigation.
Declare commands with defineCommandItem
Command items appear in the command palette (⌘K). A command can create a record (New expense), go somewhere (Go to expenses) or open a block, and may have a shortcut such as g e.
Related
- Actions and server code: make the module do things.
- Views, layouts and navigation: the concept.