A Custom Type is an element of the dynamic data model of a Structr application.
Custom types can be created and configured using the Schema Editor. A custom type has a set of default properties (depending on its Base Type), and can have zero or more dynamic properties of various types. The data model supports simple inheritance, so custom types can extend other custom types to share common properties and methods.
Fig. 1: A base type (User) and two custom types
Custom types can be linked to other types, including base types, which can be seen in the above screenshot. Structr will automatically create Remote Attributes on either side of the link, which can then be used to create, update or remove the relationships between instances of the two types.
The properties of a custom type can be combined into named Views, which are accessible under an individual REST URL. Access to these URLs can be configured independently for each HTTP method using Resource Access Grants, which makes them an ideal tool to create specialized endpoints for different client applications (e.g. mobile clients etc.).
Custom types can be extended with scripted business logic, either through the standard Callback Methods, or through Custom Schema Methods. Custom schema methods can be executed from the Web Frontend using Action Buttons.
Custom types and their properties can be mapped and transformed to better support integration with external systems. See Virtual Types for more information about that.
The underlying database structure consists of five types:
SchemaMethod. Each custom type is represented by a
SchemaNode instance. It can have relationships to other schema nodes via the
The attributes of a custom type are represented by instances of
SchemaProperty, which are linked to the schema node. Views are represented by
SchemaView instances, and methods are likewise represented by
SchemaMethod instances. Since Structr creates REST resources for all of its known types, schema nodes and all other schema-related types can be managed via REST.
SchemaMethod instances that are not connected to a
SchemaNode can be used to provide resuable functions. See the
call() function for more information about that.
- The Structr Knowledge Graph
- About Structr
- Getting Started
- Installation and Setup
- Structr on GNU/Linux
- Guides and Tutorials
- Tips & Tricks
- Installation and Setup
- Working with Structr
- Pages and Templates
- Custom Types
- Base Types
- Property Types
- Active Elements
- Action Buttons
- User Interface
- Built-In Functions
- Advanced Topics