Sorry, we don't support your browser.  Install a modern browser

Parent Field

In field methods, it’s currently not possible to distinguish fields that are direct children of a page from those that are nested members of a structure field. This is problematic if you need to access the field settings for instance because you cannot use $field->parent()->blueprint()->field($fieldKey) to get the field definition ($fieldKey is not known to the parent page because it belongs to the structure in that case).

It would be great if fields provided a new method $field->parentField() which returned the parent field (e. g. the structure field) if available or null if the field is not nested.

2 years ago
1