How do I create a repeatable two field 'set' with a custom preview?

I am looking into switching to Kirby for building my client sites. I started yesterday to install and try it out.

Question:
How can I make Kirby to show a repeating set of fields in the panel?
And preview not showing in a table, but in a user recognisable layout.

Example:
(first paragraph:)
field 1: paragraph title
field 2: paragraph text

(second paragraph:)
field 1: paragraph title
field 2: paragraph text

(nth paragraph:)
field 1: paragraph title
field 2: paragraph text

Solutions i have tried

  • structure
    I have tried with ‘type: structure’ in the page blueprint file. The problem is the preview of the data is presented in a table, I want to show each field contents on their own line and with their own markup. e.g. Title will be previewed as a H2 element.

  • structure with a field preview
    As I understand, This will only change the field inside the table. I don’t want to see the table.
    Field preview with a field plugin, using ‘k-myfield-field-preview’

  • fieldset
    I found information about field sets, but wasn’t able to do anything with it, being a novice at Kirby

  • entry:
    I found you could change the way the structure is entered. I tried it, but didn’t work. And there is no mentioning of entry: in the docs anymore. I found a link to information on a getkirby slack, but couldn’t goto or join it.

  • Kirby builder
    I installed Kirby builder and defined just one block type. With two fields. This shows exactly what i need. But there are problems with this:
    a. There are unneeded icons (preview and edit) which I couldn’t delete from the preview
    b. For some reason when adding a ‘Quote’ field, it didn’t go into edit mode. I had to press ‘add’ and then ‘edit’ on the new entry to enter a new set.
    c. It seems a lot of extra code for a simple thing. I like to use standard Kirby first, if I can.

Question
What is the preferred way to solve this use-case in Kirby?

Thanks!
René

If you don’t like the table output of the structure field, there are only two options: Builder or custom field.

Kirby builder:

  • unneeded icons: you can probably hide them via a custom stylesheet
  • quote field: hm, don’t know if there is an issue with this
  • lot of extra code: the builder will become a native field in a future Kirby version

Alternatives:

  • A custom field based on the structure field with a different output template.
  • The Editor with only a headline and a paragraph block (but then you cannot control if the user always enters a headline followed by a paragraph).

Thank you!

It’s good to know the builder is becoming a part of standard Kirby, that was a big concern.

(I will test the example code of the builder again to verify if it’s really a bug.)

Also I will try to grasp creating a custom field.

Thanks for your answer!
It’s very helpful to know the preferred route of how to solve this.

René