Programmable blueprint with Layouts/Blocks

I’m trying to use programmable blueprints with blocks/layouts. Seems to work just fine for blocks, but for layouts it’s causing the columns to be shown as rows:

The programmable blueprint reads a yaml file and merges it with an array.

use Kirby\Data\Yaml;

$yamlFilePath = __DIR__ . '/layout.yml';

// Read the file contents
$yamlContent = file_get_contents($yamlFilePath);

// Parse the YAML content
$parsedData = Yaml::decode($yamlContent);

$yaml = [
    'fieldsets' => [
        'common' => [
            'label' => 'Common',
            'type' => 'group',
            'extends' => 'fieldset/common',
        ],
        ...
    ]
];

return array_merge($parsedData, $yaml);

The yaml file contains the layouts fieldset:

layouts:
  - 1/1
  - 1/2, 1/2
  - 1/3, 1/3, 1/3
  - 1/4, 1/4, 1/4, 1/4
  - 5/12, 7/12
  - 7/12, 5/12
  - 1/3, 2/3
  - 2/3, 1/3

Everything else works as expected, but the layouts are displaying as rows instead of columns. They displayed as columns before using the “programmable blueprints” approach.

Any ideas?

And the layouts portion of the array that gets returned in the plugin index.php looks like this:

If you don’t find a solution in the meantime, I will look into this tonight.

Thanks @texnixe! :slight_smile:

Could you please provide your complete code, I’m a bit at a loss where you are using this.

@texnixe Actually, I got it working! Though, I’m not sure how. Still unclear what changed.

Cool! Thanks for reporting back.