Sharing content

Content Hub enables each website in a content network to publish content to the central repository, from which other websites can import the content. A website in a content network can act as a publisher for some content and a subscriber for other content. The original publisher of a content entity controls the definitive content of the entity, and any changes made by a subscriber website that imported the content entity are not contributed back into the Content Hub. The Content Hub API enables client applications to act directly on the Content Hub, creating, modifying, and deleting content entities.

What can be shared?

Content Hub supports sharing of entities, such as nodes and taxonomies. The hub is concerned with the sharing of content. It is possible to share additional layout elements (including blocks and panels), or configuration information (such as field configuration) with Content Hub.

Content Hub and its Drupal modules do not currently support every entity or use case. Some contributed modules implement entities that are compatible with Content Hub, including the following:

For specific configuration information, see Modules to use with Content Hub .

Acquia recommends testing all entities on a development environment before sharing them with the hub in production. For information about configuring your development environment for testing changes, see Using Acquia Lift with testing environments.

Configuring shared content entities in the Content Hub client

To share content from your website to other members of your content network, you need to configure which entity types you want to make available for sharing. You can configure this in the Drupal administration page for the Content Hub client.

  1. In the admin menu, go to Configuration > Content Hub Connector, and then click the Entity Configuration tab.
  2. Select the entity types that you want to make available for sharing. All entities of these types will be shared through the Content Hub and made available to all the other members of your Content Hub network. You can choose not to share specific properties of a shared entity type. See Excluded properties.
  3. If you are an Acquia Lift user, you must also ensure that you select at least one view mode for any content type you wish to publish. Acquia Lift can import nodes from Content Hub for both Drupal 7 and Drupal 8.

    Select a view mode

  4. In the User Role list, click a role to determine how the content type will be rendered. Content Hub will use the permissions of the selected role for both displayed content and generated CDF data.
    In many cases, the Anonymous user default option is fine. However, if applicable, be sure to select the proper role to ensure that subscribing websites do not receive sensitive data.
  5. Click Save configuration.

View modes determine the way a piece of content is displayed. Drupal has several built-in view modes, and others may be added by users. Drupal 8 makes use of these view modes to enable users to more easily control their content across multiple websites.

To resync your content, complete the following steps:

  1. Go to Content > Content Hub.
  2. In the Keyword field, enter the type of content you changed, such as article.
  3. Select the checkbox next to Import to site to select all content.
  4. Click Import to site.

For information about custom blocks and view modes, see Using blocks with Content Hub.

Which entities are shared

To be shared, an entity type must exist on both the publisher (source) website and the subscriber (target or consumer) website. The entity type does not need to be defined with exactly the same fields. Fields in shared entities that don't exist on the subscriber website will be ignored.

Block sharing

Because blocks are not entities in Drupal 7, the Content Hub Blocks module for Drupal 7 (included with Content Hub) must be enabled to share blocks. This module allows Drupal 7 blocks to be pushed to Content Hub as rendered content entities. These rendered entities are only available to be used for personalization and cannot be syndicated.

To enable this module, complete the following steps:

  1. Sign in to your website as an administrator, and in the admin menu, click Modules.
  2. Select the check box for the Content Hub for Blocks module.
  3. At the bottom of the page, click Save configuration.
  4. In the admin menu, go to Configuration > Content Hub Connector, and then click the Entity Configuration tab
  5. Select the block content types that you want to make available for sharing.
  6. Click Save configuration.

After enabling the module, a Publish to Content Hub check box will appear on the block editing page. The enabled module also provides the following Drush command to export blocks by block ID:

drush -l [URI] ch-export-block [blockID]

Configuring webhooks

To receive content from other members of your content network, you need to set up webhooks on your website. To do this, complete the following steps:

  1. In the admin menu, go to Configuration > Content Hub Connector, and then click the Webhooks tab.
  2. Enter the webhook URL. The default webhook URL is:

    http://[site_URL]/content-hub/webhook
  3. Click Save configuration.

Deleting content using webhooks

When content is unpublished or deleted from your publishing website, you may also want to remove the content from your subscribing websites. To do this, create a small, custom module, as described in Deleting content from Content Hub.

Removing and reindexing by content type

If you alter content types on a subscribing website, and want Content Hub to use the new or altered fields in your content type, you can use drush ach-reset to remove, reset, reindex, and reimport all entities matching the content type you specify.

Contact supportStill need assistance? Contact Acquia Support