Object field in Structure field -> visualisation issue

When I add an object field as a field to a structure field, there’s no visualisation in the panel UI:

It’s visualised as {...}. Is this expected? Can this be adjusted?

When you open the item; it’s like this:

Yes, this is expected. It seems difficult to put all the attributes of the object on a single line. But you can show this custom preview however you want:

Sorry for reopening this thread, but I am having a real hard time to preview the objects inside my structure field:

columns:
  settingsNav:
    width: 1/1
    sections:
      nav:
        type: fields
        fields:
          navHeader:
            type: structure
            label: Header
            fields:
              linkObject:
                type: object
                label: Link Objekt
                fields:
                  link:
                    type: link
                    label: Link
                    required: true
                  linkText:
                    type: text
                    label: Text

i try to preview the content of linkText. How can I do this? The provided link does not include an example of an object nor is the blueprint behind the structure field visible…

Thanks

Ps. BTW I am on Kirby 4

1 Like

Same problem for me… (K4)

I’m trying to add a preview of the object field but my plugin seems to not be taken in account.

My yaml configuration

type: group
fields:
  menuItem: fields/link
  attributes: fields/attributes

which include the link field blueprint

label: field.link.label
type: object
empty: no-link-yet
fields:
  label:
    label: field.link.label.label
    type: text
    width: 1/3
  link:
    label: field.link.link.label
    type: link
    width: 2/3
  newTab:
    label: field.link.newTab.label
    type: toggle
    default: false

My basic JS plugin

panel.plugin("project/extended", {
	// fields: {
	//     myfield: {
	//         ...
	//     }
	// },
	components: {
		"k-menuitem-field-preview": {
			props: {
				value: String,
				column: Object,
				field: Object
			},
			template: "<p>Your preview code goes here</p>"
		}
	}
})

The naming for the component is wrong, must be the type of the field, here object, not the name you give it in your blueprint.

Thank you Texnixe :slight_smile:
My basic custom preview works : I have my label field value shown, but I can’t figure out how to have a link preview instead of page://uuid…

I did some digging around this too a few months ago. I’ve settled on this: GitHub - bvdputte/kirby-linkobject

Maybe you can use as inspiration?

It works now :slight_smile:

To have a link preview I can simply use the template of a link component.

Thank you.