Content Hub 2.x is a departure from previous versions of Content Hub, and contains several new capabilities. To begin developing with Content Hub 2.x, it can be helpful to understand the differences between these two versions.
Before attempting to syndicate your data, you must understand your data’s underlying structure. To examine the data objects in your Drupal-based website, including their connections and how they are related to one another, install the Dependency Calculation module.
The Dependency Calculation module performs the following actions:
In Drupal, non-standard relationships are relationships between entities that are not represented by standard relationship models, such as an entity reference field. If your website creates non-standard relationships between two entities or entity types, you must define a dependency calculation event subscriber to inform Drupal of the relationship, which enables the relationship to be syndicated from the publishing website to the subscribing websites.
For example, websites that embed entities into text areas using a module (such as the Entity Embed module) frequently require additional media entities for proper syndication of the original entity and its embedded content. For successful syndication in Content Hub, this dependency must be declared in a dependency calculation event.
Although serialization processes (such as REST) are commonly used to send data from one website to another website, using these processes may not the correct approach. Examples of issues that may occur include the following:
To resolve issues that may arise (including the previously described problems), Content Hub 2.x focuses on replication, and not serialization. Instead of using Drupal’s normal serialization processes, Content Hub depends on a small set of field- and entity-level interpreters that can serialize and unserialize field-level data in safe, multilingual formats, which can be converted into normal entity data during import.
Custom entity types can work well with Content Hub, assuming that non-standard relationships define dependency calculation event subscribers.
When creating custom field types, evaluate the handlers in place for serializing and deserializing your field’s data. Content Hub provides some classes which will attempt to determine how to handle your field’s data, but you can also develop your own classes to define how to properly handle your data.