TimOetting / kirby-builder

A site builder extension for Kirby CMS
398 stars 51 forks source link

Structure field not working #128

Closed guidoferreyra closed 2 years ago

guidoferreyra commented 5 years ago

Hi! when I try to use a structure field inside the builder it fails while saving. It returns e is null. Any ideas?

TimOetting commented 5 years ago

Hey @guidoferreyra . Does your problem still exist? Can you post the blueprint for your usecase? I checked to have a structure field inside the builder and it worked in my case

guidoferreyra commented 5 years ago

Hi, maybe I’m doing something wrong?

this is my blueprint:

footerColumns:
    type: structure
    fields:
       column:
           type: builder
           fieldsets:
               columns: blocks/columns
luxlogica commented 5 years ago

@guidoferreyra I'm a bit confused: you said you wanted to use a "structure field inside the builder", but your blueprint above seems to show that you're actually doing the opposite: putting a builder inside a structure. Would you be able to confirm?

Just in case, I have tested BOTH, with Kirby 3.3 and the latest Builder:

You can test this by setting up a new 'plainkit' installation of Kirby, installing the Builder field plugin, and then putting this in your site/blueprints/home.yml blueprint:

title: Home Page
sections:
  content:
    type: fields
    fields:
      struct_in_builder:
        type: builder
        label: Structure in Builder
        fieldsets:
          struct:
            name: Structure
            fields:
              addresses:
                type: structure
                fields:
                  street:
                    label: Street
                    type: text
                  zip:
                    label: ZIP
                    type: text
                  city:
                    label: City
                    type: text
      builder_in_struct:
        type: structure
        label: Builder in Structure
        fields:
          quotes:
            type: builder
            fieldsets:
              quote:
                name: Quote
                label: Quote by {{citation}}
                preview:
                  snippet: blocks/quote
                  css: /assets/css/blocks/quote.css
                defaultView: preview
                fields:
                  text:
                    label: Quote Text
                    type: textarea
                  citation:
                    label: Citation
                    type: text

@TimOetting we should probably either:

  1. close this issue - as there does not seem to be a problem with structure fields inside the builder, or
  2. change the title - to something like 'Preview Issues with Builder inside Structure field'.

But TBH, I'd be inclined to close it, as the use-case of someone wanting to have a builder field inside a structure field seems extremely rare. And even in this case, this issue would be more related to the Structure field than to the Builder field itself.

TimOetting commented 2 years ago

Closing this issue because this plugin will no longer be maintained, as its main functionality can be replaced by Kirby's built-in Blocks Field and Layout Field.