Problem to get structurefield to work in the Panel

I’m a little bit confused using structure fields. I don’t get it work properly.
I have an blueprintfile partner.php

title: Page
pages: true
files: true
		label: Title
		type:  text
		label: Text über Partnerauflistung
		type: textarea
	size: large
	icon: align-left
	label: Adressen
	type: structure
	entry: >
      {{street}}<br />
      {{zip}} {{city}}
			label: Street
			type: text
			label: ZIP
			type: text
			label: City
			type: text

It contented actually the example from the documentation.

Here you can see what I get at the panel, no fields. What do I wrong?


I assume there’s something wrong with your indentation. Can’t really tell from what you posted above, but if I copy and paste the above code into a text editor, it is wrong.

what is wrong in your texteditor?
Here in the editor it changed the indentation.
I copied it direct from the Kirby documentation and changed the spaces into tabs. And yet this worked proper until the structurefield.

It looks alright, but all I can tell you is that the missing fields are a typical sign of incorrect indentation within the structure field. With correct indentation, the blueprint works perfectly, see screenshot of what it should look like in your editor.

1 Like

thank you very much for you tip with the wrong indentation.
I set the invisible characters on and see that before fields where four spaces.
Also I have mixed the indentation.

Glad you sorted it out :grinning: Whenever you have a problem with blueprints, check for

  • correct indentation
  • correct field names
  • matching file names

Hints to all:

  • I never use tabs, I always use two spaces for indentation
  • I always use Notepad++ (on windows surely), it changes all tabs to two spaces each, I always set the invisible characters on, it writes UTF-8 and linux/unix line endings (on windows!)

Hints to all:

  • I avoid capital letters in all file names

I know, this is no necessity (e.g. on windows), but it avoids errors on other webservers :wink:

I hereby propose that such hints (like these from @texnixe) should be included in the documentation of Kirby. It is not the first time that these are a problem for a newer user/developer using Kirby.

Hi Heiner,

but spaces are not tabs. On a semantik way tabs doing other than spaces and I think it should do it also on programming.
To use spaces to prevent mistakes are the wrong way. To it right and you have no problems!
And always use Notepad is also no a possible way to prevent mistakes. First as a kill argument I work on OSX ;).
Also to set always invisible characters to show is not a way for me because I think it makes the source code bad to read.

I think it is better to learn to do no mistakes or if something is wrong, know where the mistakes can be.

But I think standard mistakes to include in the documentation is a good way to prevent and help beginners.

I have never had problems with tabs in my blueprint yaml files (rather sometimes with spaces), but in fact, the yaml specs do not allow tabs but only spaces, due to the fact that tabs are handled differently by different systems.

However, the number of spaces is irrelevant as long as all sibling nodes use the same amount of indentation.

The important thing here is to know where to look for errors, not which editor you use.