Panel, Blueprint and width of fields

Fields within a fields section can have a width of less than 100%. And the fields automatically float next to each other. But I can’t get fields within other sections to behave the same way. Am I doing something wrong?

title: Default Page

sections: # keyword that allows you to add multiple section types
	fields: # keyword, this is a Fields Section
		type: fields
		fields:
			dog-pages:
				type: pages
				width: 1/2
			cat-pages:
				type: pages
				width: 1/2	

	pages: # keyword, this is a Pages Section
		rabbit-pages:
			type: pages
			width: 1/2

What is this? The type of section is missing and you cannot put a field or section below this keyword.

Wrong field names, no dashes allowed.

Argh, I always forget that no dashes are allowed. Okay, the fields in a Fields Section are half the width, but the field in a Pages Section is not. Is there a reason for this?

title: Default Page

sections:  
	fields: # 1st section is a Fields Section?
		type: fields
		fields:
			dog_pages: # name of field
				type: pages
				width: 1/2
			cat_pages: # name of field
				type: pages
				width: 1/2	

	pages: # 2nd section is a Pages Section?
		rabbit_pages: # name of field
			type: pages
			width: 1/2

Also, how come the name of the ‘rabbit_pages’ field, in the Panel is displaying as ‘Pages’?

Yes, why are you trying to put fields into a pages section? This is just not possible. The only section that can have fields is a fields section, as the name says.

Is a “field” the field/box in the Panel for the editor to type stuff into, or edit in some way? Like a form has fields to fill in?

Are these fields?

Screenshot 2024-04-17 at 6.02.06 PM

So in my Pages Section/bit of the Panel I want a field for the editor to add pages to.

I can only repeat it:

If you want to put a field somewhere, you need a fields section.

I only recently updated the guide: Structuring blueprints | Kirby CMS

title: Default Page

sections: # keyword that allows you to add multiple section types
  fields: # keyword, this is a Fields Section NO, its not the name fields that determines what type this section is but the type: fields, so even if a call this 'yummy', it will by a fields section because of the type
    type: fields # this here determines the section type!!!
    fields:
      dogPages:
        type: pages
        width: 1/2
       catPages:
         type: pages
         width: 1/2	
  ## This here does not make any sense, either this should be a pages section
  pages: # keyword, this is a Pages Section: No,  here the type is missing
    type: pages # if we add the type: pages here, then the stuff below is useless
      rabbit-pages: ## so this line then needs to go away
        type: pages
        width: 1/2

Is this screenshot and my annotations correct?

Fields are allowed in a Fields Section. But not in a Pages Section? Even though in the Panel they look similar? They both look like a field on a contact form.

A ‘section’ suggests a group. In a Fields Section it is possible to group together more than one field. In a Pages Section is it possible to have more than one page thingy (if it is not called a field, I don’t know what to call it), for example different lists of different pages? If not, it seems odd to call it a ‘section’? It is a section of one.

The only type of sections that groups something (fields) is a fields section. All other sections are stand-alone sections.

Yes, the screenshot is correct: 2 sections (a fields section and a pages section, 2 fields in the first)

Please study the documentation carefully and rewatch the videos if needed.

Maybe it’s also worthwhile to hire someone who goes with you through all of this if you want to continue with Kirby and the docs/videos are not enough.

I think Kirby’s use of words creates confusion:

A section indicates a group of things (in this case fields). It implies that sections contain fields. And these fields behave differently depending on what type of section they are contained in.

Also the word ‘field’. A field to me suggests a contact form fields. In the Panel some things do look like fields, but some things that look like fields - but are inside a Pages Section - are not called a field (even though they look almost identical to fields).

Think of it as a hierarchy:

  1. each area in the panel (or at least those that allow blueprints) can have tabs.
  2. each tab can have columns
  3. each column can have sections. The available sections are:
    • Pages (normally to show and manage subpages)
    • Files (normally to show and manage files)
    • Fields (to save content into the page)
    • Info (help and info text)

Each section has different options you configure via the blueprint. You can’t use the options of the Fields section on the Pages section, the same as you can’t use the options for a Files section in the Info section: it wouldn’t make any sense.

For Fields sections in particular, one option is the “fields” property where you list all the fields you want in that “group of fields”.
One of the field types you can use in the Fields section is the “Pages field”. I understand that it might seem confusing, but the “Pages field” is very different from the “Pages section”.
As with almost every other field type, the contents of the Pages field is saved as text into the page content text file: its purpose is to select pages, not to “manage” them. It’s the purpose of the Pages section to manage them.

In your example you are probably abusing the pages field. A better example would be to have a dogPages section to manage all the dogs, then have, as an example, a “Dog show winners” pages field where, for every contest, you can select the winning dogs (without having to insert the Dog details for every contest).

1 Like

Blueprints: Sections and Fields.

I think the word ‘sections’ is misleading.

A book has sections. Each section will consist of one or more pages, grouped together.

Kirby Blueprints has sections. A Fields Section will consist of one of more fields, grouped together.

But then the concept of a ‘section’ fails. The other sections – Files, Info, Pages, Stats – do not and can not consist of one or more fields. These sections can not group together fields. Nor can they even include one field.

To carry on the book analogy these sections consist of no pages at all. So the word ‘section’ is misleading.

I think sections are:

  • misleading because they aren’t sections/groups
  • look and work almost identically to fields
  • it’s not clear what the benefit of having sections is

Could they be removed from future versions of Kirby?

The five default section types would simply be renamed and made as field types:

Fields section = would no longer be needed so could be removed entirely.
Files section = renamed as files-list (or something) and made into a field
Pages sections = renamed as pages-list and made into a field
etc.

This would entirely remove the confusion between a Fields Section and a Field in a Fields Section. Or between a Pages Section and a Pages Field.

The first definition of the word “section” in the oxford dictionary, according to google, is:

any of the more or less distinct parts into which something is or may be divided or from which it is made up.

In our case, sections are the distinct parts into which the blueprint columns are divided.

The different use cases of choosing vs managing pages or files, as in my example above, make the distinction between sections and fields mandatory.

I think questioning the wording of something won’t really help you. It is as it is, after all, so you need to understand what is means in the Kirby context. Otherwise, using Kirby will not make sense.

Okay, just trying to help. My hunch is ‘sections’ and ‘fields’ is something (new) users trip up over? Personally I’ve found it mind bindingly difficult to get my head around it . But I’ll stop mentioning it now and move on. Cheers

For feature suggestions, we have https://feedback.getkirby.com.

We cannot simply rename elements, this would be a breaking change, that would affect thousands of sites. IMO, it wouldn’t help, either. Maybe we will one day bring together fields and section, but for the time being, we will have to live with it.