Change logic of display of fields of a reusable component from a plugin

Hi everyone !

I want to change the display logic of my fields of a certain reusable component that I created on my admin Panel.
For example :
if fieldA ===‘A’ then FieldB is hidden
As I understood, I need to create a plugin (which I did), but I am failing to find on how to retrieve my reusable component ( that is gonna be used in a lot of places, dynamic zones etc…) and apply my logic on it !
thank you in advance for any feedback !

This topic has been created from a Discord post (1217166327039397919) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

You need a custom field based on JSON

Hi !
Thank you for your answer, but I am failing to understand how does that help me ? Can you elaborate more ?
Me I was thinking that the plugin will retrieve the component, and the fields of that said component, and add some conditions on the display, is that the wrong approach ?

It’s wrong approach

During creation there is no component yet, so there is nothing to retrieve

But you can create custom filed based on json, so you can store selection and value in this field and use it to switch your custom view

Notice it’s quite limited, and needs kinda boilerplate to work

and you would not be able to query json field

So if you don’t expect to search upon that field you can kinda work with it

Okay thanks !
I will check the documentation on how to do that !
thanks for your help !

Last Question : can I use a custom field inside my custom field, for example if one of my fields uses ckeditor5 ?

Not straight

You gonna need to somehow customize it