TimOetting / kirby-builder

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

Field Groups #89

Closed bavarianbytes closed 2 years ago

bavarianbytes commented 5 years ago

Tried to use both variants of reusable field groups (via fieldname: /path/ and via fieldname:\n extend: /path/ ), but they do not seem to work (Error: unknown field type "group").

Are there any possibilities to reuse field groups?

saschabregenhorn commented 5 years ago

This doesn't answer your question, but you can organize the builder blocks in single files as well and combine them via „extends“, e.g.

extends: blocks/preferences-textareas

Even works „nested“.

bavarianbytes commented 5 years ago

Thx! But therefore you cannot compile multiple files into one field block, can you?

TimOetting commented 5 years ago

@bavarianbytes good question. Did you try it? Under the hood, Kirby Builder uses a native method. I am not sure if it also works with multiple extends. Would this be possible with field groups?

bavarianbytes commented 5 years ago

Multiple extends are not possible (array given, string expected). I think it's not the concept of extends. Extending means to use a blueprint and add some stuff. I think Kirbys "field groups" are for joining fields from different sources together.

Therefore i think it would be cool if Builder would support the field type "group" (The field type "group" does not exist).

mrflix commented 5 years ago

I'm porting a builder setup from kirby v2 to kirby v3. It is a form builder and since all fields have some settings in common I grouped them:

type: group
fields:
  name:
    label: Name
    type: text
    required: true
  mandatory:
    label: Mandatory
    type: checkbox
    default: true
    text: has to be filled out
    width: 1/2
  width:
    label: Width
    type: select
    default: full
    options:
      full: Full Width
      1/2: 1/2
      1/3: 1/3
      2/3: 2/3
      1/4: 1/4
      2/4: 2/4
      3/4: 3/4
      1/5: 1/5
      2/5: 2/5
      3/5: 3/5
      4/5: 4/5
    width: 1/2

So I, too, had to learn that grouping is not yet supported in builder: The field type "group" does not exist error

As I said, I will make them work for the builder field.

Source. Will you keep your pinky promise and support them in builder, Tim?

hentrev commented 5 years ago

I'm facing the same problem that the field groups are not working within the builder plugin. Did anyone find a workaround in the meantime?

chrispreisler commented 4 years ago

I would also love to get support for field type: group.

gexcube commented 4 years ago

I would love to see this too

plagasul commented 4 years ago

May it be the same problem is true when reusing simple fields ? not groups, but a single field, such as:

fields/color

label: Background Color 
type: radio
default: black
columns: 2
options: 
    black: Black 
    grey: Grey 

I am trying to incorporate such field in a block:

name: Myblock
fields:
        color: fields/color

... and I get an error:

image

...should I open a separate issue?

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.