Configuration

Bynder

We will start off by doing the preparations on the Bynder instance. A few things need to be set up here.

Permanent token

You can create a permanent token by navigating to ‘Advanced settings’ > ‘Portal settings’ > ‘Permanent tokens’ using the cog in the upper right hand side of the application, provided you have the necessary rights to do so.

Clicking ‘Add new’ prompts a form with a Bynder user selection. This would preferably be linked to a dedicated user, since the history/actions will be linked to the selected one. The user should have the following permission active: img

Next up you select the access scopes of the token: img

After selecting the user, scopes and confirming, a permanent token should be generated (store it somewhere on temporary location as leaving the page will obscure the token) which we can use to add to the credentials in Akeneo.

Metaproperties

A few metaproperties need to be defined/existent to link to a product’s (or model’s) identifier and the related attribute within that product in Akeneo.

  • First of all, we want a product identifier with the adviced configuration as following img
  • Then we define the same type of metaproperty, but for product model codes img
  • We want to make sure there is a metaproperty that contains/links to the attribute name that reflects the image attribute name of the product in Akeneo. The following setup would be adviced. img
  • There is an optional possibility to map 1 metaproperty option to multiple image attributes, provided they have the same name affixed with a dash and count. (f.e. ‘application’ in bynder => ‘application_1’, ‘application_2’ in Akeneo CE) In that case, an order field needs to be added in Bynder to define the order of the assets that get linked. img

The metaproperty configurations above are what we think the most optimal configurations in terms of usability and added value. As long as the metaproperty is available through the Bynder API (ApiField) and the value reflects/maps with the corresponding values in Akeneo, the asset will get linked.

Akeneo CE

Now that we set up Bynder and we have the permanent token at hand, we can provide mapping and credentials to Akeneo, and have the linking/enrichment jobs scheduled.

Credentials

Adding Bynder credentials to Akeneo CE is done in the UI using the credentials manager provided with the connector. Browse to System > Credentials manager and click on ‘create credential’. Provide the code input with the value ‘bynder’ and select one time key as the type of credential. img When added, you can add the hostname (f.e. induxx-demo.bynder.com) and the permanent token. That’s it!

Mapping

Let’s revisit the bynder_attribute_mappings.yml we added in the installation step. Below we provided some context to the parameter names. What key => value in this configuration is concerned, we are mapping Akeneo (key) to Bynder (value).

metaproperty_mappings Used to map the required Bynder metaproperties to Akeneo attributes
asset_type_metaproperty_options_mappings If the asset type (the image attribute name) is a select, you can (optionally) map the values to the corresponding metaproperty options in Bynder
sortable_asset_type_metaproperty_mappings Used to map attributes that are sortable. Example attribute code is ‘application_image_1’ the mapped ‘sort_order’ meta property has on the asset 3 as value. The attribute code that will be used is ‘application_image_3’.
enrichment_metaproperty_mappings define what attributes need to be used to enrich a metaproperty in Bynder
enrichment_metaproperty_options_mappings If the akeneo attribute above is a select with options, you can (optionally) map the option’s value to the correct one in Bynder
enrichment_metaproperty_locale_mappings If it’s a localizable attribute that is mapped to enrich Bynder, we need to define what locale we want to see synced.
derivative_to_use defaults to ‘original’, this is optional to define what type of derivative needs to be linked to the product instead of the original
asset_unlink_after_archiving default to ‘true’. Bynder has the possibility to archive an asset, this parameter gives you the option whether or not to unlink the asset in Bynder in this event
update_metaproperty_on_empty_only_mappings here you can define the attributes for enrichment that will only update the mapped metaproperty in Bynder if it hs no prior value set

Cronjobs

Linking an asset and providing enrichment to an asset is achieved using scheduled commands (cronjob):

bin/console induxx:bynder:update-properties Link assets selected/uploaded in Akeneo using the correct identifiers and asset types every 1-5min
bin/console induxx:bynder:update-mapped-properties Provides enrichment to the asset using the mapped attributes every 15-30min
bin/console induxx:bynder:import-assets Links assets from Bynder to Akeneo using product identifiers and asset types every 1-5min

We have added suggestions on the intervals on which the jobs should be executed. This is project-specific and should be finetuned accordingly.

All commands have the same 2 options available:

  • --max_updated_time_in_minutes, which defaults to 60. It’s adviced to set the time to the interval length of the cronjob
  • --credential_code, defaults to ‘bynder’. If another credential code would have been used during the configuration, it can be defined here.