I wish to programmatically set the value of a Neo field.
This is my current approach:
$entryData = self::setupEntryData($item);
$entry = new Entry($entryData);
$fieldValues = [
'heading' => $entryData['title'],
'blocks' => [
'blocks' => [
'new0' => [
'modified' => 1,
'type' => 'wysiwyg',
'enabled' => 1,
'collapsed' => 0,
'level' => 0,
'fields' => [
'grayBackground' => true,
'wysiwyg' => '<p>test</p>',
'buttons' => null,
]
]
]
],
];
$entry->setFieldValues($fieldValues);
Of course this doesn't work.
Can someone point me in the right direction?
Here is a screenshot of the Form Data that is passed when setting the value manually from Craft CMS.
Just to confirm, my Neo field is called blocks
.
My target blog type has a handle of wysiwyg
.
The Redactor field I target has a handle of wysiwyg
.
Thank you!