Skip to content

Instantly share code, notes, and snippets.

@Ferdi
Created June 21, 2021 17:31
Show Gist options
  • Save Ferdi/708837b8f38969363b90bfcb40f5d516 to your computer and use it in GitHub Desktop.
Save Ferdi/708837b8f38969363b90bfcb40f5d516 to your computer and use it in GitHub Desktop.
---
collections:
- category: Content
folder: content/resources
label: Resources
name: resource
fields:
- {
label: Title
name: title
required: true
widget: string
}
- {
label: Description
name: description
widget: markdown
minimal: true
}
- {
label: File Type
name: filetype
required: true
widget: select
options:
- Image
- Video
- Document
- Other
}
- {
label: File
name: file
widget: file
}
# show the field below only if the type of resource is "image"
- {
label: Image Metadata
name: metadata
widget: object
condition: {field: filetype, equals: Image}
fields:
- {
label: Text alternative
name: image-alt
widget: string
}
- {
label: Caption
name: caption
widget: string
}
- {
label: Credit
name: credit
widget: text
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment