The Content Marketing Platform (CMP) comes with native support for Drupal versions 7 and 8. This topic describes how to setup your Drupal site for integration with CMP.
Integrate a Drupal site
- Go to your avatar and select Integrations.
- Open the Website, CMS & Feeds tab.
- Select Add > Drupal.
- Enter the Name, Public URL, and select the Website Type.
- Click Save to integrate your website with the CMP.
You need a new or existing feed channel where you publish content and then have the content ingested into your Drupal site.
Integrate with Drupal 8
- To use Drupal 8, download and install newscred-8.tar.gz.
- Enable the module from the list of modules.
After you install and enable the module there are multiple ways to ingest the feed from the CMP - you can fetch it programmatically in your theme, via a custom module or use the default Feeds Module.
- Install the following modules from https://www.drupal.org/project/feeds and enable Feeds only, because the rest are automatically enabled.
- Feeds – https://www.drupal.org/project/feeds
- Feeds JSONPath Parser – https://www.drupal.org/project/feeds_jsonpath_parser
- CTools – https://www.drupal.org/project/ctools
- Job Scheduler – https://www.drupal.org/project/job_scheduler
- Click Structure and select Feed Types.
- Click Add Feed Type and fill in the fields as shown.
- Enter the mapping. You can add fields based on how you want the content to appear on your website.
- Click Save to move on to ingesting a feed.
- Copy the JSON/ATOM API link, which is exposed when you click Export Feed, and add that link on the Drupal site. The link is shown in the following way in the CMP.
- Click Content, click Feeds, and click Add Feed.
- Add a Title of your choice and paste in the ATOM Feed URL and click Save and Import. The articles are automatically ingested and published.
Integrate with Drupal 7
- To use Drupal 7, install newscred-7.tar.gz.
- Enable the new module.
After you install and enable the module there are multiple ways to ingest the feed from the CMP - you can fetch it programmatically within your theme, via a custom module or use the default Feeds Module.
- Install the following modules and enable Feeds only, the rest should be automatically enabled.
- Feeds – https://www.drupal.org/project/feeds
- Feeds JSONPath Parser – https://www.drupal.org/project/feeds_jsonpath_parser
- CTools – https://www.drupal.org/project/ctools
- Job Scheduler – https://www.drupal.org/project/job_scheduler
- Configure your Importer to match our Feed attributes
- Go to Structure > Feed Importers.
- Click Add importer.
- Add your desired basic settings.
- Configure node settings.
- Create a mapper that introduces fields onto your Drupal database.
- Configure your parser to map feed attributes with your created fields above.
- Click Save to create the importer.
- Go to Structure > Feed Importers.
- Go to Structure > Feed Importers.
- Select Import importer and paste in the contents of this file in the text area and click Save. (Other fields can be left blank.)
- Copy the JSON/ATOM API link, which is exposed when you click Export Feed, and add that link onto our Drupal site.
- Click Add Content of type Article.
- Find the input field to enter the Feed URL. Paste in the JSON Feed URL and click Save. The articles are automatically ingested and published.