If you are looking into implementing a behavior for storage that is eventually field-based, then you are on the right page! Since it is quite likely that many behavior implementations will be field-based, we have walked an extra mile to facilitate this particular case.

First of all, there is synonyms_provider_field submodule that:

- implements some behaviors for a set of common field types (see this page for particular details)
- provides a good starting point for implementing behaviors for new field types

Apparently, on this page we will focus on the 2nd item from the list above. If you implement a behavior for a new field type, then:

- Implement behavior interface for a particular field type. You are encouraged to extend your PHP class from AbstractFieldSynonymsBehavior. It has a few methods that will make your life easy. However, you are nowhere close to be obliged to use that abstract class; only as long as it helps you to achieve your goal.
- Notify synonyms_provider_field submodule about availability of a new field type.

Now let us see each of the steps in further details.

## Implementing behavior interface

Look up in behavior cTools plugin definition of your interest what interface it declares. The cTools plugin must be of type behavior owned by synonyms module. The interface is declared under the interface property of the plugin definition. Read the documentation for that interface and write a PHP class that implements this interface for your particular field type. We cannot give more precise instructions about this step, because it all depends on the interface of the behavior.

## Notifying synonyms_provider_field submodule about your new implementation

For the purposes of such notification we have the following hooks in synonyms_provider_field submodule:

- hook_synonyms_field_behavior_implementation_info() to collect info from modules about field types available for synonyms behavior implementations
- hook_synonyms_provider_field_behavior_implementation_info_alter() to alter previously collected info from modules about field types available for synonyms behavior implementations

Implementing either of the 2 hooks is highly straight forward, you will just inform the submodule about what field type is exposed to behavior implementation through what PHP class for a given behavior. Then the synonyms_provider_field submodule will analyze what fields are attached to what entity types and will convert this data into the format expected by the core Synonyms module. For more details, refer to synonyms_provider_field.api.php file.