Follow

Integrate with Drupal

What Is This Feature?

Kapost’s integration with Drupal enables you to publish content you create in Kapost directly to Drupal.

  • Supported content types: HTML
    • Files can be sent to Drupal by implementing the XML-RPC files API, which you can find here.
  • Supported versions: Kapost supports Drupal 7 and Drupal 8
  • Supported analytics: total page views, click-throughs, inbound links, downloads, Facebook shares
  • Kapost uses XML-RPC to interact with Drupal

How It Helps

Drupal is an open-source content management software. It provides a framework for websites, ranging from personal blogs to corporate and government sites. Drupal’s modules and tools enable users to build versatile, structured content for dynamic web experiences.

Drupal is highly customizable. We recommend that you speak with your Kapost Implementation Manager or Customer Success Manager to discuss the best way to set up this integration.

How It Works

Connecting your Kapost instance to Drupal requires some technical expertise. The connection can be finalized by a non-technical Kapost Admin who’s familiar with your Drupal instance(s).

Whether you use Drupal 7 or Drupal 8, both require installing and enabling the latest versions of the XML-RPC and Kapost modules.

These modules are free to install. They must be up to date and you must have access to your Drupal server to install these modules.

The XML-RPC endpoint must be publicly available to connect to your Drupal instance.

  • Kapost will try to construct the XML-RPC endpoint URL based on the URL of the Drupal instance. If the URL is http://testdrupal3.example.com, then Kapost will assume the XML-RPC endpoint URL is http://testdrupal3.example.com/xmlrpc.php.

Along with the XML-RPC endpoint URL, to connect to Drupal you’ll need a current Drupal account that you can access with a Drupal username and password. This user needs to be able to create and update nodes, and it’ll be the user account that connects to Drupal from Kapost.

  • We recommend you create and use a Kapost-specific Drupal user account with the desired role/permissions for this integration rather than using an existing user to avoid any disruption if the user is suspended or removed from Kapost (in which case their access will be revoked).

Note: If the Drupal module is installed after a connection has been established in Kapost, you’ll need to resave the connection in order for Kapost to detect the module’s presence as well as other features and capabilities.

Installing and Configuring Drupal 7

To connect to Drupal 7, install and enable the Kapost Byline Module and the Blog API Module. These must be installed in addition to the XML-RPC and Kapost modules.

Someone who manages your Drupal instance must install the Kapost Byline module manually by placing the unzipped (unarchived) module into /sites/all/modules or /sites/default/modules inside the Drupal installation.

Then, to enable the Kapost Byline Module, navigate to the Kapost Module Settings in Drupal in the Modules tab. Find the Kapost section, and check the checkbox to enable the module.

Screen_Shot_2019-06-14_at_10.15.08_AM.png

Now you’re ready to configure the Kapost Byline Module. Click the Configure button and you’ll go to the configuration options page. At the top of this page, you’ll see checkboxes to enable or disable a number of options.

Screen_Shot_2019-06-14_at_10.15.42_AM.png

  • Create User and Use existing User (only): These settings are related to Kapost’s setting, On publish, always use the CMS User as the author, which is only applicable when that setting is turned off (the default). If these boxes are checked, Kapost will create or use existing Drupal users during publishing in order to implement correct bylining. (See more details on this below in the Installing and Configuring Drupal 8 section.)
  • Preview: This enables or disables the Kapost’s Preview feature. For more information, see the Preview a Drupal Post in Kapost section, below.
  • Analytics Tracking Code: This adds the Kapost Analytics Tracker code into posts when they’re viewed.
  • Relative URLs: This turns URLs returned for uploaded images into relative URLs.

Under these options is the Article section. For each content type enabled in the Blog API Module’s settings, there are several field mappings: Categories, Tags, and Feature Image.

  • Kapost maps to these fields to sync with them. If no field mapping is specified, the Kapost module will use default built-in mappings.

Screen_Shot_2019-06-14_at_10.16.21_AM.png

The final section on this page is the Taxonomy section. For each content type enabled, there’ll be a group of taxonomy, or vocabulary, field mappings.

  • The CMS Category sync will use these mappings to pull categories into Kapost. If no vocabularies are selected for a given content type, then all vocabularies will be pulled in into Kapost on category sync.

Screen_Shot_2019-06-14_at_10.16.44_AM.png

Next, install the Blog API Module. The latest version of the Blog API module can be downloaded from the standard Drupal Project Repository: https://www.drupal.org/project/blogapi.

Now you’re ready to configure the Blog API Module. In Drupal, navigate to the module in the Configuration tab. Find the Web Services section, where the BlogAPI subsection is located.

drupal_blogapimodule.gif

Here, ensure that you select MetaWeblog as the default provider.

Screen_Shot_2019-06-14_at_10.18.57_AM.png

You’ll also want to define the pictured settings options in the Node Types and File Settings sections.

  • Each selected node type (article or basic page) will appear as an individual blog in Kapost on your Drupal connection in your instance’s App Center settings area. This means that to publish from Kapost to multiple content types, multiple connections in Kapost are required for each content type.
  • Define the file size per upload and per user to 100 MB. Pick a larger limit if you’re going to upload very large images. If your max file size isn’t large enough, your images won’t publish correctly with your content.

Screen_Shot_2019-06-14_at_10.19.32_AM.png

Finally, you’ll ensure that the correct user permissions are set up in Drupal. In Drupal, navigate to the People section to manage BlogAPI permissions.

  • Failing to set up the proper permissions will prevent Kapost from being able to publish content correctly.

Screen_Shot_2019-06-14_at_10.20.02_AM.png

Installing and Configuring Drupal 8

To connect to Drupal 8, install and enable the Kapost Byline Module. This must be installed in addition to the XML-RPC and Kapost modules.

Someone who manages your Drupal instance must install the Kapost Byline module manually by placing the unzipped (unarchived) module into /sites/all/modules or /sites/default/modules inside the Drupal installation.

Then, to enable the Kapost Byline Module, navigate to the Extend tab in Drupal and ensure the checkbox next to Kapost is checked.

Screen_Shot_2019-06-14_at_10.20.47_AM.png

Now you’re ready to configure the Kapost Byline Module. Navigate to the module in the Configuration tab. Find the Web Services section, where the Kapost Settings subsection is located.

drupal8settings.gif

Here, configure the module to ensure the connection’s parameters are correct.

drupa8settings2.png

  • Each selected content type (article or basic page) will appear as an individual blog in Kapost on your Drupal connection in your instance’s App Center settings area. This means that to publish from Kapost to multiple content types, multiple connections in Kapost are required for each content type.
    • You can select the default text format, such as Basic HTML, which will be used for all fields with text format support.
  • Article: Each selected content type will have a group of field mappings: Body, Category, Tag, and Featured Image. Kapost will use these mappings when syncing with any of these fields. If no field is mapping is specified for a given field, then Kapost will ignore it.
    • The Category Field is special: The CMS Category sync feature will use the Taxonomy (or vocabulary) associated with it to pull Categories into Kapost.
  • Create User: This setting is related to Kapost’s setting, On publish, always use the CMS User as the author which is only applicable when that setting is turned off (the default). If the box is checked, Kapost will create or use existing Drupal users during publishing in order to implement correct bylining.
  • Preview: This enables or disables the Kapost’s Preview feature. For more information, see the Preview a Drupal Post in Kapost section below.

Finally, you’ll ensure that the correct user permissions are set up in Drupal. In Drupal, navigate to the People section to manage user permissions.

  • Failing to set up the proper permissions will prevent Kapost from being able to publish content correctly.

drupal8peeps.gif

Publishing Content to Drupal

Next, add Drupal 7 or 8 as a publish destination in Kapost’s App Center.

  • Kapost Admins can access the Kapost App Center from Kapost via their Kapost instance. Go into your App Center settings area and click on the Install More Apps button below your list of connections. You’ll be taken to the Kapost App Center.

Screen_Shot_2019-06-14_at_10.24.09_AM.png

  • If you haven’t installed and enabled the XML-RPC and Kapost modules, you won’t be able to connect Kapost and Drupal.

In the Kapost App Center, use the search field to find the Drupal connection. Choose your Kapost instance from the drop-down menu, and click Install.

AppCenter.gif

Once you click Install, you’ll be directed back to your instance’s App Center settings area where you’ll see your new Drupal integration. Enter the authentication credentials for the Drupal user you’re connecting (explained above at the top of the How It Works section).

When you click Connect, a pop-up will appear asking you which blogs you’d like to publish to Drupal from Kapost. In Drupal, these are called content types or nodes. Find them in Drupal by going to Content Types in the Structure area. Here, select the blog/node you’d like the connection to publish to.

  • You can only connect to one blog/node per Drupal connection. To publish to more than one node, you need to create another Drupal connection. You may use the same user for multiple connection with Drupal, but each connection must have a different node.

Screen_Shot_2019-06-14_at_10.25.55_AM.png

Next, Admins will add Drupal as primary publish destination for the content type you want to publish content from Kapost to Drupal. Go to the Content Types & Workflow in settings area in Kapost and choose the Drupal instance(s) you want to set as a primary destination. Click save to record your updates.

Screen_Shot_2019-06-14_at_10.26.25_AM.png

If you’re not sure which content types will be used to publish with your integrations, speak with your Kapost Admin or Customer Success Manager.

When you’ve completed these steps, you’re ready to publish content directly from Kapost to Drupal.

Publishing Settings

Manage your publish settings in the App Center in your Kapost instance. The Publishing section on this page, below your list of integrations, contains the publishing options.

Screen_Shot_2019-06-14_at_10.27.42_AM.png

  • Author info controls how the author info is appended to the content body on publish.
    • Kapost’s bylining feature consists of appending information about the content assignee at the end of HTML post body. Its most basic form is: “Post Author: Name of Assignee.”
  • Under Permissions, Don't allow people to edit their info on their profile locks down the user profiles on the user profile page.
  • Under Permissions, On publish, always use CMS User as author means that, on publish, instead of creating a user based on the author's email within your CMS, the user who is connected in the App Center as the author is set as the content author.
  • Publish Date sets the publish date to be whatever the publish task deadline in the workflow is.
  • Featured Image is a workaround for Drupal themes that duplicates the featured image. 

Live or Draft: When publishing content, you can publish it as “live” or “draft.”

  • Publishing content as a draft means the post you create will have its state set to draft.
  • If the same post is re-published a second time in draft state, the already existing draft will be updated and no new posts will be created.
  • If the same post is re-published again as live, the existing draft is transitioned into the published state, and no new posts will be created.
    • When publishing live, the date the content is published will be set as the publish date in Drupal
  • Publishing content as live means the content will be live on your site. Subsequent republishes will update existing live content, and no new posts will be created.

Drupal 7’s supported field types are:

  • Image
  • File
  • Entity Reference
  • Node Reference
  • User Reference
  • Taxonomy (Term) Reference
  • Text (Long)
  • Text (List)
  • Date (non iso)
  • Date Time (iso date time)
  • Timestamp or Datestamp (unix timestamp)
  • Text
  • Boolean
  • Integer

For example, in the image below there is a category field with the field type Term reference and the machine name field_categories. In order to sync this field during publish, you’ll create a drop-down or multi-select custom field in Kapost with its field name set to field_categories.

Drupal 8’s supported field types are:

  • Content Reference
  • User Reference
  • Taxonomy (Term) Reference
  • Timestamp (unix timestamp)
  • DateTime (iso date time)
  • File
  • Image
  • Text
  • Text Long
  • Text With Summary
  • Text Formatted
  • List (Integer)
  • List (String)
  • Integer
  • Boolean
  • Link

For example, in the image below there is a category field with the field type Entity Reference with the sub-type set to Taxonomy (Term) Reference and the Machine Name field_tags. In order to sync this field during publish, you’ll create a drop-down or multi-select custom field in Kapost with its field name set to field_tags.

Reference Fields in Drupal 8

There a several reference field types you’ll see if you’re using Drupal 8:

 

  • Entity Reference
  • User Reference
  • Node Reference
  • Taxonomy (Term) Reference

 

The Entity, User, and Node field types are drop-down or multi-select custom fields in Kapost. These reference field types hold a unique reference ID to link a piece of content with another entity.

The Taxonomy (Term) field type doesn’t use a reference ID. Instead, this field type is looked up by the term name. The Kapost module takes care of this look-up, so in Kapost you can enter the actual term name and it’ll translate into the correct reference ID in Drupal 8.

Preview a Drupal Post in Kapost

When the ability to preview is turned on, Kapost Admins and Editors can preview Drupal content in Kapost.

  • By default the ability to preview a Drupal post is turned off. Previewing can be enabled in the Kapost Module Settings. Once previewing is enabled, refresh your connection in your instance’s App Center by re-saving the connection.

When this is set up, you’ll see a Preview option in the More drop-down menu on the content details page for your Drupal content. Click Preview in this menu to preview your content during the creation process.

  • If you have more than one Drupal destination set up, a pop-up will appear to prompt you to select the right destination for the preview.
  • Previews will create draft versions of your content in your Drupal instance. The draft versions will be removed once the content is ultimately published from Kapost.  
  • Previewing content that’s already published will show the content as it is currently; it won’t update the content based on changes made in Kapost after the content is published.
  • The generated preview URL is valid for six hours if you’re connected to Drupal 7, and five minutes if you’re connected to Drupal 8. This URL can be shared externally of Kapost.

Preview.png

If you’d like to further configure your Drupal 7 or 8 integration with images, excerpts, SEO, and more, read this help article on how to customize your integration.  

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments