Hi!
In a plugin I’m extending the fieldMethods of a textarea/writer field. As this field could also appear in a block, I’m trying to get the block object from the $field variable.
Basically something like this:
'fieldMethods' => [
'inlinefootnotes' => function ($field) {
$blockId = $field->isChildOfBlock() ? $field->parentBlock()->id() : false;
return InlineFootnotes::convert($field, $blockId);
},
the parent() method just gives me back the $page element.
Is there another way to do this if the $field is not aware of its parent block?
Thanks!