Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using drafts doesn't work as expected on blueprints using groups #5802

Open
thedoofus opened this issue Jun 19, 2024 · 0 comments
Open

Using drafts doesn't work as expected on blueprints using groups #5802

thedoofus opened this issue Jun 19, 2024 · 0 comments

Comments

@thedoofus
Copy link

thedoofus commented Jun 19, 2024

I have a Page blueprint, that uses groups to allow me to choose between a Simple page and a Builder page. The Builder blueprint also uses several mixins to allow me to add different section types to a page.

I can create a builder page, then start a new draft from it. But when I attempt to apply the new draft, the page reverts back to the original primary record and it appears all my changes on the draft are lost.

The drafts feature works perfectly fine from a simple page . But things just get a bit funky with the builder page type.

I'm also not aple to switch between simple and builder page when making a draft this way, the button isn't available to me in the top right corner.

Here's my set blueprint set up if it helps.

page.yaml

handle: Content\Pages;
type: structure
name: Pages
drafts: true
primaryNavigation:
  label: Pages
  icon: ph ph-browsers
  order: 150
groups:
  dynamic:
    name: Dynamic Page
    fields:
      builder:
        tab: Edit
        type: mixin
        name: Builder
        source: Page\Builder
  simple:
    name: Simple Page
    fields:
      content:
        label: Content
        tab: Edit
        type: richeditor
        span: adaptive
        column: false
        scope: false

builder.yaml

handle: Page\Builder
type: mixin
name: Builder
fields:
  builder:
    type: repeater
    label: Builder
    displayMode: builder
    span: adaptive
    prompt: Add a Block
    groups:
      cards:
        name: Cards
        icon: icon-columns
        description: A grid of cards
        useTabs: true
        fields:
          cards:
            type: mixin
            source: Builder\Cards
      grid:
        name: Grid
        icon: icon-th-large
        description: A grid of tiles
        useTabs: true
        fields:
          grid:
            type: mixin
            source: Builder\Grid

grid.yaml

handle: Builder\Grid
type: mixin
name: Grid
fields:
  content:
    label: Content
    tab: Edit
    type: richeditor
    span: full
  items:
    tab: Edit
    type: mixin
    source: Builder\GridItem

griditem.yaml

handle: Builder\GridItem
type: mixin
name: Grid Items
fields:
  items:
    label: Grid Items
    type: repeater
    displayMode: builder
    prompt: Add Grid Item
    form:
      fields:
        content:
          tab: General
          label: Content
          type: richeditor
          span: full
        icon:
          tab: General
          label: Icon
          type: mediafinder
          mode: image
          span: left
          maxItems: 1
        icon_alt_text:
          tab: General
          label: Alt Text
          type: text
          span: right
        card_link_text:
          label: Card Link Text
          default: Find out more
          span: left
          type: text
        card_link_target:
          label: Card Link Page
          type: pagefinder
          span: right

cards.yaml

handle: Builder\Cards
type: mixin
name: Cards
fields:
  content:
    label: Content
    tab: Edit
    type: richeditor
    span: full
  items:
    tab: Edit
    type: mixin
    source: Builder\Card

card.yaml

handle: Builder\Card
type: mixin
name: Card
fields:
  items:
    label: Cards
    type: repeater
    displayMode: builder
    prompt: Add Card
    form:
      fields:
        content:
          tab: General
          label: Content
          type: richeditor
          span: full
        icon:
          tab: General
          label: Icon
          type: mediafinder
          mode: image
          span: left
          maxItems: 1
        icon_alt_text:
          tab: General
          label: Alt Text
          type: text
          span: right
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant