Information for: DEVELOPERS   PARTNERS

Getting started with Content Hub 2.x

Prerequisites

  1. Install Git and Composer. You’ll need them to install the Acquia Content Hub modules.
  2. Contact Acquia Support or your Account Manager for a demo Content Hub subscription if you don’t already have one.
  3. Create an Acquia Cloud Free Tier application with Drupal 8. If you don’t have an Acquia account, create one. This gives you a Dev and Stage environment to test Acquia Content Hub syndication. Dev and Stage environments, ready for use.

Setting up a development environment

Create a publishing website in your Dev environment by installing the Umami Demo Profile that ships with Drupal 8.6+. Having existing entities and configuration is useful for understanding Content Hub syndication.

  1. In your Dev environment, click Install Drupal. Select Install Drupal to add Drupal to your environment
  2. Go through the Drupal install wizard. In the Choose profile step, select Demo: Umami Food Magazine. Select the Umami demo profile during installation.

Setting up the Stage environment

Your subscribing website will be the Stage environment.

  1. In the Stage environment, switch the code branch to Master. Stage now set to the same codebase as Dev, without the database setup.

  2. Click into the Stage website and go through the Drupal install Wizard.

  3. Install the Standard Drupal install profile. This Drupal installation profile doesn’t install with the demonstration content types, content, and other configuration in the installation of the Demo: Umami Food Magazine profile.

    Choose the standard Drupal installation

The bare Standard website is a perfect testing ground for syndication; when publishing from the Umami website, all the content and configuration syndicates into the Standard Drupal install, showcasing how Content Hub syndicates entities and configuration from one website to another, even with different themes.

You have now created two Drupal install profiles, one in your Dev environment and one in your Stage environment. The Dev environment is using the Demo: Umami Food Magazine Drupal profile, while the Stage environment is using the Standard Drupal profile.

Installing the Content Hub Module

Notes

  • We will be installing Content Hub using composer locally and then pushing those changes to Acquia Cloud.

  • Acquia Cloud codebases are shared between environments, so you’ll only need to commit and push the modules once.

  • Certain Drupal installations lock Zend-diactoros to version 1.4. Acquia Content Hub requires version 1.8 or greater. If you see an error stating Your requirements could not be resolved to an installable set of packages., you must update.

    To update, run:

    composer require zendframework/zend-diactoros:^1.8

    For more information: https://www.drupal.org/project/drupal/issues/2989631

  1. If you are familiar with checking out your codebase from Acquia Cloud, do so now and skip to step 7.

  2. If you’re unfamiliar with Acquia Cloud, an easy way to run Composer commands (to install the Content Hub modules) is to install Acquia Dev Desktop. Download and install Acquia Dev Desktop

  3. Sign in to your newly created Acquia Cloud account.

  4. Select your new website from the list of websites within Acquia Dev Desktop.

  5. Select the Clone this website locally and use it in Dev Desktop button.

  6. In the dialog, click OK with the defaults set. Your website clones locally, although we’ll be using the cloned website to add the Content Hub modules to the codebase, not to actually work on the website locally.

  7. Open your codebase directory in the command line. In Dev Desktop, click the small terminal icon to the right of Local code.

    Using Acquia Dev Desktop, select the terminal icon to open your local codebase in a shell.

  8. In the terminal window, run the following command to install the Content Hub module and its dependencies:

    composer require drupal/acquia_contenthub:^2
    

    A terminal window, displaying the installation of the Content Hub modules.

    If you see an error that says Your requirements could not be resolved to an installable set of packages., refer to the note about updating zend-diactoros.

  9. Commit your changes to the remote repository on Acquia Cloud using the following commands:

    git add .
    git commit -m 'Content Hub install'
    git push origin master
    

    A terminal window, displaying the results of pushing to master

    Acquia Cloud will now have the modules and dependencies in the latest commit you pushed to the hosted repository.

Setting up a publishing website

After installation, create a publishing website.

Publishing Website (Umami Profile)

  1. Sign in to your publishing website as an administrator. You can access the website by logging into the Drupal website using the username and password during the initial setup or by using Drush.
  2. In the Admin menu, click Extend.
  3. Enable the Acquia Content Hub and Acquia Content Hub Publisher module. Select the Content Hub and Content Hub Publisher modules to enable

Configure your publishing website

  1. Sign in to the publishing website as an administrator.

  2. Go to Configuration > Web Services > Acquia Content Hub.

  3. Enter your the following information. If you don’t have it, see Obtaining your Acquia Content Hub credentials. Add the Content Hub publisher settings.

    • Acquia Content Hub Hostname
    • API Key
    • Secret Key
    • Client Name Pick something memorable that accurately describes this website to anyone that sees it, such as publisher_dev. Your client names should be unique per website and environment and formatted without special characters. The Content Hub service uses this client name to distinguish where your content was created. The name you choose here is arbitrary and the nomenclature you use is up to you and how you’d prefer to govern the websites within your Content Hub account. We don’t force your naming schema.
    • Publicly Accessible URL This field populates with a default value. Since we’re on Acquia Cloud, your website will be accessible by default; if you are attempting to install the module in an inaccessible location (for example, locally), you can register your website with the service, but you’ll see an error message that the Content Hub service won’t be able to access your website (which will prevent certain key features of Content Hub syndication from working).
  4. Save your configuration and continue. If you don’t see any errors, you have connected the website to Content Hub.

    A successful connection to the Content Hub service

  5. To try out Content Hub’s exporting capabilities, visit Manage > Content. Select the check mark all the content and re-save everything. This enqueues your publishing content for export.

    Re-saving entities to enqueue the export to Content Hub

  6. You can see the number of enqueued items by visiting Configuration > Web Services > Acquia Content Hub > Export. The content hasn’t exported to the Content Hub service. Export will happen after setting up the subscribing website.

    Click Export items to test synchronization.

Setting up a subscribing website

  1. Sign in to your subscribing website as an administrator.

  2. In the Administrator menu, click Extend.

  3. Enable the following modules:

    • Acquia Content Hub
    • Acquia Content Hub Subscriber
    • Acquia Content Hub Curation

    Select the modules for Content Hub subscribing websites

    The Subscriber module handles the import process for your syndicated content, while the Curation module provides an interface to create Cloud Filters, which are essentially the rules for what content will syndicates to what websites in your Content Hub account.

Configure your subscribing website

  1. Sign in to the subscribing website as an administrator.

  2. Navigate to Configuration > Web Services > Acquia Content Hub.

  3. Enter the following information:

    • Acquia Content Hub Hostname

    • API Key

    • Secret Key

    • Client Name Pick something memorable which accurately describes the website to anyone who sees it, such as subscriber_test.

      Content Hub subscriber module settings

  4. Save your configuration and continue. If you don’t see any errors, you have connected the website to the Content Hub service. Once your webhook connects to the Content Hub service, the subscriber will enqueue data for import as it’s exported by your publishing website.

  5. Set up a filter for your subscribing website by going to Content > Acquia Content Hub. By default, content will only import if you manually click Import. A filter ensures any content matching the parameters of the filter will import as soon as the import queue is run. Create a filter. For example, in Type menu, select Node and then click Save Filter.

    Create a cloud filter

  6. In the Save New Filter dialog box, add a name, and then click Save Filter. Adding a name to a new cloud filter

    The filter displays under the Saved filters menu on the left side. The list of saved filters

  7. Assign your filter to one or more websites. Click Assign Sites and select the check box for the URL of your subscribing website’s webhook and then click Save. Select a check box for the subscribing website's webhook.

You are now ready to syndicate content.

Syndicating with Acquia Content Hub

  1. Visit your publishing website again. Go to Configuration > Web Services > Acquia Content Hub > Export. You’ll see the number of items enqueued to export to Content Hub.

  2. For testing purposes, click Export Items. Once you are ready to use Content Hub in production, you’ll want to set up a scheduled job to run the export.

    Click Export items to test synchronization.

    As the export processes, a progress bar displays:

    Processing the export queue

    When complete, the Export page displays zero items in the queue.

    The export queue shows zero items for export.

  3. Once the export completes, visit your subscribing website. Navigate to Configuration > Web Services > Acquia Content Hub > Import.

  4. Click Run Import Queue to process the import queue.

    Click the Run import queue button to manually process the queue

    Once you are ready to use Content Hub in production, you’ll want to setup a scheduled job to run imports.

    The entities process through the import queue until completed.

  5. After the import queue completes, go to the Content screen. The nodes from the publisher should have imported. The nodes are different content types, many of which weren’t initially a part of the standard Drupal install. Content Hub syndicates entities and configuration, which means you don’t have to set up a single content type-the module takes care of it for you.

    One original article on our dev environment's Publishing Website (the Umami profile)

    One original article on our dev environment’s Publishing Website (the Umami profile.)

    The same article, but now syndicated article in our Stage environment's subscribing website (Standard Drupal profile).

    The same article, but now syndicated article in our Stage environment’s subscribing website (Standard Drupal profile). The content displays in a completely different manner since the Standard profile’s theme is minimal.