kirby-color-palette icon indicating copy to clipboard operation
kirby-color-palette copied to clipboard

Can't access palette array in a block

Open janstieler opened this issue 1 year ago • 0 comments

Hi, I try to use this plugin inside a block but if I try to output the field with ->yaml() I got an array but the keys I can't select. If I write

$palette = $block->palette();
$background = $palette['background'];
$name  = $palette['key'];

also

$palette = $block->palette();
$background = $palette[0];
$name  = $palette[1];

result in an error Undefined array key "background" or Undefined array key "0". With dump I can output the array but nothing inside the arraqy. thats strange.

Cheers

janstieler avatar Jun 30 '23 00:06 janstieler