Skip to content

Instantly share code, notes, and snippets.

@bobdenotter
Created August 22, 2018 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobdenotter/4a627c31cdcc0efdc8c6a5044fbc87d3 to your computer and use it in GitHub Desktop.
Save bobdenotter/4a627c31cdcc0efdc8c6a5044fbc87d3 to your computer and use it in GitHub Desktop.
A contenttype definition to see selects in Repeaters, Blocks and Templatefields
  1. Add the contenttype
  2. add the section to theme.yml
  3. Create a new dummy, and set the template to record.twig
  4. reload.
dummies:
slug: dummies
singular_slug: dummy
fields:
title:
type: text
class: large
slug:
type: slug
uses: title
multiselect:
type: select
values:
'atuin': A-tuin
'donny': Donatello
'raf': Raphael
'leo': Leonardo
'mick': Michelangelo
'koopa': Koopa
'squirtle': Squirtle
multiple: true
postfix: "Select your favourite turtle(s)."
template:
type: templateselect
filter: '*.twig'
contentrepeater:
type: repeater
label: Content Repeater
group: Repeato!
limit: 3
prefix: "<p>This allows you to create multiple sets of fields. Use the add button at the bottom to create a new empty Repeater set.</p>"
fields:
repeattitle:
type: text
repeatimage:
type: image
extensions: [ gif, jpg, png ]
repeatcontent:
type: html
multiselect:
type: select
values:
'atuin': A-tuin
'donny': Donatello
'raf': Raphael
'leo': Leonardo
'mick': Michelangelo
'koopa': Koopa
'squirtle': Squirtle
multiple: true
postfix: "Select your favourite turtle(s)."
contentblocks:
type: block
label: Content Repeaters
group: Blocko!
prefix: "<p>This allows you to create multiple sets of fields. Use the add button at the bottom to create a new empty Block set.</p>"
fields:
imagesection:
label: Image with description
fields:
heading:
type: text
image:
type: image
description:
type: html
height: 70px
textsection:
label: Paragraph
fields:
heading:
type: text
content:
type: html
height: 100px
Selectsection:
label: Selection section
fields:
heading:
type: text
multiselect:
type: select
values:
'atuin': A-tuin
'donny': Donatello
'raf': Raphael
'leo': Leonardo
'mick': Michelangelo
'koopa': Koopa
'squirtle': Squirtle
multiple: true
postfix: "Select your favourite turtle(s)."
templatefields:
record.twig:
schedule:
label: Schedule
type: repeater
group: schedule
fields:
turtles:
type: select
values:
'atuin': A-tuin
'donny': Donatello
'raf': Raphael
'leo': Leonardo
'mick': Michelangelo
'koopa': Koopa
'squirtle': Squirtle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment