Hi everyone,
I want to use the plugin “Annotator” in my Kirby Page Builder.
I already got everything to work when I just set everything up on a page. But now I also want to be able to use the annotator as a builder block, because I have other blocks (fieldsets) that I want to place around the annotator section.
Unfortunately I cant seem to get the blueprint for the builder block working. When I add the annotator fieldset on my page builder, I will get errors like “Cannot read property ‘key’ of undefined” (when I used sections in line 4) or something like " Error in “annotator” field" “The field type “annotator” does not exist” (when I used fields in line 4)
On my page.yml it is called like this (image-pins):
title: Fahrzeugss
icon: file-document
sections:
imageslider:
headline: Gallery
type: files
template: gallery
meta:
type: fields
fields:
# inside the fields section of your blueprint:
mybuilder:
label: Page Builder
type: builder
columns: 1 # Optional. If set to 2 or more, the builder blocks will be placed in a grid.
max: 10 # Optional. Limits the number of builder blocks that can be added.
fieldsets:
text_only:
extends: blocks/text_only
zitat:
extends: blocks/zitat
image-slider:
extends: blocks/image-slider
image-pins:
extends: blocks/image-pins
I think it might be something so simple and easy that I just don’t get here?
I really do appreciate the help
Please always post all context, not half a field, otherwise it is very difficult to spot errors.
I am very sorry, I don’t quite get what you mean by that, because I posted the content of my 2 whole .yml files. Is it because there was no fieldname, because the fieldname is called in the other .yml with “extends”? My fieldname is called “image-pins”. How can I do better next time? Please bear with me, I just started coding and asking questions in a forum this way and still need to learn some things.
Thank you for your code, but it doesn’t work for me. I get “Cannot read property ‘key’ of undefined”. I think “fields” won’t work for the “annotator”. In the original syntax from the github page it looks like this:
So for the annotator sections is needed. But I cannot use sections in my example, because the kirby page builder calls for fieldsets, right?
title: Fahrzeugss
icon: file-document
sections:
imageslider:
headline: Gallery
type: files
template: gallery
meta:
type: fields
fields:
# inside the fields section of your blueprint:
mybuilder:
label: Page Builder
type: builder
columns: 1 # Optional. If set to 2 or more, the builder blocks will be placed in a grid.
max: 10 # Optional. Limits the number of builder blocks that can be added.
fieldsets:
text_only:
extends: blocks/text_only
zitat:
extends: blocks/zitat
image-slider:
extends: blocks/image-slider
image-pins:
extends: blocks/image-pins
Ah, ok, it is a section, not a field, didn’t see that. Anyway, since you can’t use a section inside a builder fieldset but only fields, using it inside a builder field won’t work.
No, you cannot use sections within a builder field. What you could do instead, is set the markers in the image metadata and then select those images within your builder field, if that’s an option.