Is your website running on Craft CMS? Great! With our Craft CMS plugin you can publish your Story Chief stories to your website. This is how it works:

Step 1: download and install

Download & unzip the plugin and place the storychief directory into your craft/plugins directory.

Install plugin in the Craft Control Panel under Settings > Plugins

Step 2: configure

Login to storychief.io and navigate to Channels, click on Craft CMS.

  1. Click on 'Add New Destination' button to link your Craft CMS website to Story Chief. 
  2. Enter the url of your Craft installation below (ex: http://example.com)
  3. Copy the Encryption key.
  4. Click the "Save" button below

Go to the Story Chief config page on your Craft CMS website

  1. Paste the encryption key in the corresponding field and press save configuration.
  2. Choose the entry type Story Chief should use to create articles. 
  3. Map the story Chief fields to your entry fields. 
  4. Click on save configuration

Csrf Protection

If you have CSRF checks enabled, Craft needs the csrf token to be present on all inbound post requests to controllers. Because Story Chief is posting to the site externally, and can't include that token as part of their request, Craft will reject the inbound calls.

Because the cause of the issue is part of the Craft core, and there's no direct way to override the checks at the controller level, instead we have to fix it at the config level.

Fix

You must create an exception for the route in your general config. In general.php, where you're setting the enableCsrfProtection, update it to the the following:

'enableCsrfProtection' => (!isset($_SERVER['REQUEST_URI']) || $_SERVER['REQUEST_URI'] != '/storychief/webhook'),
Did this answer your question?