How to know if the field is used in a structure Field

Hi,

I am trying to build a field named “Repeater” who can be used with the “Structure” field and normal blueprint. My plugin need to know when it uses in or out a structure field. But Var $parentFields apparently don’t return information correctly, it return only false.

I need to return a string in normal condition and an array in structure field condition.

Someone has a solution ?

If I can’t do the trick dynamically I am going to add a parameter to the field option.

I can share my field if you want but for now it is a try.

I dug through the Panel code and debugged it. This is actually a bug and the $parentField parameter is intended to contain the structure field but it doesn’t.

I have opened an issue on GitHub. Thanks for reporting!

There is now a solution for this issue and a fix will be included in the next Kirby release. You can try it out by checking out the develop branch of the Panel.