willpublicmedia / npr-api-expressionengine

Access the NPR API from within ExpressionEngine.
1 stars 1 forks source link

NPR Story API ExpressionEngine Module

Deprecation Warning: The NPR Story API is no longer actively maintained. Stations wishing to share NPR content should use the NPR Content Distribution System instead. See also the NPR CDS module for ExpressionEngine.

Summary

The NPR Story API module wraps NPR's Story API Wordpress plugin in an ExpressionEngine module. By default, installation will create a default channel, required fields, and a publish layout suitable for pushing to and pulling from the NPR Story API.

The plugin also allows channel mapping, allowing existing channels to push to or pull from the story api.

Setup

Install Addon Files

  1. Clone the project as npr_story_api. Note: ExpressionEngine requires the project directory to be named npr_story_api.
  2. From the command line, cd to the project directory.
  3. Run php composer.phar install.

Basic Configuration

  1. (Optional) From the Control Panel's Files interface, create an NPR Images file location and grant privileges to appropriate user groups.
  2. From Control Panel > Developer > Addons, install the plugin.
  3. Click the NPR Story API settings icon:
  1. Save settings.

Channel Mapping

Mapped channels must have access to all fields required by the story api (NPR Story API field group), and be configured as mapped in the api settings. Channel naming conventions are strongly recommended.

Using the API

Pulling a Story

  1. Create a new channel entry in a mapped channel.
  2. In the publish tab, add any title text.
  3. Switch to the Options tab
  1. Click Save.

The story will be pulled and mapped to expression engine. The title and URL field will be overwritten by the remote story. Note that the URL will only be overwritten when creating a new story, not on edit. This prevents URLs from changing on live stories. All images will be stored in the Files location configured in the API settings.

Formatting changes can be preserved by saving without using the Overwrite Local switch.

If the story is correctly formatted, change story status from Draft to Open and click Save.

Pushing a Story

  1. Enter story as usual. See the NPR Story API documentation for guidance on story element use.
  2. Switch to the Options tab and set Status to Open.
  3. Save the story before pushing to prevent work from being lost on a failed push.
  4. Switch to the Options tab:
  1. Click Save.

If the story was pushed successfully, the story will be updated automatically with the NPR story ID.

To re-push a story, make corrections, update the Publication Date (Date tab), then click Save.

Dependencies

Changelog

unreleased

3.0.14

3.0.12

3.0.11

3.0.10

3.0.9

3.0.8

3.0.7

3.0.6

3.0.5

3.0.4

3.0.3

3.0.2

3.0.1

3.0.0

2.1.2

2.1.1

2.1.0

2.0.11

2.0.10

2.0.9

2.0.8

2.0.7

2.0.6

2.0.5

2.0.4

2.0.3

2.0.2

2.0.1

2.0.0

1.0.4

1.0.3

1.0.2

1.0.1