Contentful SDK v0.3.0 Contentful.ContentType View Source
Describes functions around ContentTypes in a Contentful.Space
See the official docs for more information.
Link to this section Summary
Functions
returns the display field for a given content type
Link to this section Types
Link to this type
t()
View Sourcet() :: %Contentful.ContentType{
description: String.t(),
display_field: String.t(),
fields: [Contentful.ContentType.Field.t()],
name: String.t(),
sys: Contentful.SysData.t()
}
A ContentType is part of the content model defined in a space
Link to this section Functions
Link to this function
display_field(content_type)
View Sourcedisplay_field(t()) :: Contentful.ContentType.Field.t()
returns the display field for a given content type
Examples
content_type = %ContentType{display_field: "name", fields: [%ContentType.Field{name: "name"}]}
# extracts the display field from the content type
%ContentType.Field{name: "name"} = content_type |> ContentType.display_field