![]() ![]() Minimum number of characters for a field input value If true, adds a required validator for this propertyĬhecks if the value is greater than or equal to the given maximumĬhecks if the value is less than or equal to the given minimum Internationalization (i18n)-related typesĬan only be used if the i18n plugin is installedīasic validations can be applied to attributes using the following parameters: Parameter The type parameter of an attribute should be one of the following values: Type categories ![]() and the locale and localizations types, only used by the Internationalization (i18n) plugin.a flexible space based on a list of components) dynamiczone to define a dynamic zone (i.e.a data structure usable in multiple content-types) customField to describe custom fields and their specific keys.relation to describe a relation between content-types.media for files uploaded through the Media library.strings, dates, numbers, booleans, etc.), Each attribute has a type parameter, which describes its nature and defines the attribute as a simple piece of data or a more complex structure used by Strapi. The data structure of a model consists of a list of attributes. General settings for the model can be configured with the following parameters: Parameterĭatabase table name in which the data should be stored and options used to defined specific behaviors on the model.attributes, which describe the data structure of the model,.information, mostly used to display the model in the admin panel and access it through the REST and GraphQL APIs,.settings, such as the kind of content-type the model represents or the table name in which the data should be stored,.The schema.json file of a model consists of: Every component has to be inside a subfolder, named after the category the component belongs to (see project structure). Use the Content-type Builder or create them manually.Ĭomponents models are stored in the. Components Ĭomponent models can't be created with CLI tools. In TypeScript-enabled projects, schema typings can be generated using the ts:generate-types command. src/api//content-types//, and any JavaScript or JSON file found in these folders will be loaded as a content-type's model (see project structure). (generated automatically, when creating content-type with either method) schema.json for the model's schema definition.The content-types use the following files: or with Strapi's interactive CLI strapi generate command.with the Content-type Builder in the admin panel,. ![]() Model creation Ĭontent-types and components models are created and stored differently. The generated model mappings can then be reviewed at the code level using this documentation. The user interface takes over a lot of validation tasks and showcases all the options available to create the content's data structure. If you are just starting out, it is convenient to generate some models with the Content-type Builder directly in the admin panel.
0 Comments
Leave a Reply. |