Blueprint questions

Yes and no. It depends on your use case.

If you really want both portfolio_list_image and images_all to be fields, then they could both live in section1, no need for section2 in that case.

But I don’t think images_all should be a field. You want this to show all available images, right? Then it should be a files section.

Yes, I want images_all by default, to show all the images in the pages folder – all the images associated with the case study. I’ve changed the second section to type: files. But now the second section label/heading/title in the Panel is “Section2”, and not the label: All images. Which doesn’t make sense to me because the first section is using the correct label.

	sidebar:
		width: 1/3

		sections:
			section1:
				type: fields
				fields:
					portfolio_list_image:
						label: Portfolio list image
						type: files
						required: true
						max: 1
		
			section2:
				type: files
				fields:
					images_all:
						label: All images
						type: files

The example here: Blueprint questions - #7 by texnixe

was already correct, I don’t know why you change it again

Yes that is correct and it works. But I don’t understand why it works because you have also said each section needs:

		filessection: # Each section needs a key (name)
			type: fields # Each section has properties
			fields: # A fields section also needs to define its fields			

And in the code that works, the second section doesn’t have any of these things.

In my code below I am trying to get both sections to have these things

	sidebar:
		width: 1/3

		sections:
			section1:
				type: fields
				fields:
					portfolio_list_image:
						label: Portfolio list image
						type: files
						required: true
						max: 1
		
			section2:
				type: files
				fields:
					images_all:
						label: All images
						type: files
sidebar:
		width: 1/3

		sections:
			section1: #This is now a fields section, so ok
				type: fields
				fields:
					portfolio_list_image:
						label: Portfolio list image
						type: files
						required: true
						max: 1
		
			section2:
				type: files # this is now supposed to be a files section, but a files section does'nt have fields!!
				fields:
					images_all:
						label: All images
						type: files

The second section should just be:

section2:
  type: files
  # stop or add other files section props as in the docs: https://getkirby.com/docs/reference/panel/sections/files#section-properties

Looking good! This seems to work. I have two sections clearly named. Each section has a type. The first fields the second files. Both have a label. Does this look good to you?

	sidebar:
		width: 1/3

		sections:
			section1:
				type: fields
				fields:
					portfolio_list_image:
						label: Portfolio list image
						type: files
						required: true
						max: 1
		
			section2:
				type: files
				label: All images

Yes.

1 Like