Разные типы контента на страницах

Я работаю над небольшим сайтом, которому просто нужна простая CMS для редактирования содержимого. Итак, я начал с Болта. На данный момент у меня есть 5 страниц с разной разметкой, как и структура контента. Можно ли сделать это так? Потому что на данный момент это не работает, к сожалению.

Мои типы содержимого.yml:

pages:
name: Homepage
singular_name: homepage
fields:
    title:
        type: text
        class: large
        group: content
    slug:
        type: slug
        uses: title
    header-image:
        type: image
    title-one:
        type: text
    header-text:
        type: html
    title-two:
        type: text
    text-one:
        type: html
    body-image-two:
        type: image
    title-three:
        type: text
    body-image-text:
        type: html
    title-four:
        type: text
    text-two:
        type: html
    title-five:
        type: text
    text-three:
        type: html
    template:
        type: templateselect
        filter: '*.twig'
taxonomy: [ groups ]
recordsperpage: 100

name: Over ons
singular_name: over-ons
fields:
    title:
        type: text
        class: large
        group: content
    slug:
        type: slug
        uses: title
    image:
        type: image
    title-one:
        type: text
    title-two:
        type: text
    body:
        type: html
        height: 300px
    template:
        type: templateselect
        filter: '*.twig'
taxonomy: [ groups ]
recordsperpage: 100

name: Diensten
singular_name: diensten
fields:
    title:
        type: text
        class: large
        group: content
    slug:
        type: slug
        uses: title
    image:
        type: image
    title-one:
        type: text
    intro-text:
        type: html
    title-two:
        type: text
    text-two:
        type: html
    title-three:
        type: text
    text-three:
        type: html
    title-four:
        type: text
    text-four:
        type: html
    title-five:
        type: text
    text-five:
        type: html
    template:
        type: templateselect
        filter: '*.twig'
taxonomy: [ groups ]
recordsperpage: 100

name: Het proces
singular_name: het-proces
fields:
    title:
        type: text
        class: large
        group: content
    slug:
        type: slug
        uses: title
    image-one:
        type: image
    title-one:
        type: text
    intro-text:
        type: html
    title-two:
        type: text
    text-two:
        type: html
    image-two:
        type: image
    title-three:
        type: text
    text-three:
        type: html
    image-three:
        type: image
    title-four:
        type: text
    text-four:
        type: html
    image-four:
        type: image
    title-five:
        type: text
    text-five:
        type: html
    image-five:
        type: image
    title-six:
        type: text
    text-six:
        type: html
    image-six:
        type: image
    template:
        type: templateselect
        filter: '*.twig'
taxonomy: [ groups ]
recordsperpage: 100

name: Projecten
singular_name: projecten
fields:
    title:
        type: text
        class: large
        group: content
    slug:
        type: slug
        uses: title
    title-one:
        type: text
    intro-text:
        type: html
    title-two:
        type: text
    text-two:
        type: html
    image-two:
        type: image
    template:
        type: templateselect
        filter: '*.twig'
taxonomy: [ groups ]
recordsperpage: 100

name: Contact
singular_name: contact
fields:
    title:
        type: text
        class: large
        group: content
    slug:
        type: slug
        uses: title
    title-one:
        type: text
    intro-text:
        type: html
    template:
        type: templateselect
        filter: '*.twig'
taxonomy: [ groups ]
recordsperpage: 100

Любые идеи по решению?

Заранее спасибо.


person TheDutchRicolaa    schedule 15.12.2016    source источник


Ответы (1)


Я бы предложил использовать для этого только один тип контента "pagina". Если вам нужно разнообразить их, используйте templateselect (как вы уже делаете) и, возможно, добавьте «поле шаблона» или два.

См. здесь: https://docs.bolt.cm/2.2/templates/building-templates#template-specific-fields

person Bopp    schedule 17.12.2016