Replace components in component browser tray

I’m not sure if you want to modify the “Component Replacer” or you already tried to write your own.
Would be the best if you can provide your code what is failed, than someone may take a look on it…
__
Perhaps you can check this methods (including but not limited to)

The #load method is used to load a component from a file.

The #add method is used to add a new component definition to the definition list with the given name.

The #remove method is used to remove a component definition from the definition list with the given component definition. This will remove all instances of the definition.

The #purge_unused method is used to remove the unused component definitions.

2 Likes