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
- Click on 'Add New Destination' button to link your Craft CMS website to Story Chief.
- Enter the url of your Craft installation below (ex: http://example.com)
- Copy the Encryption key.
- Click the "Save" button below
Go to the Story Chief config page on your Craft CMS website
- Paste the encryption key in the corresponding field and press save configuration.
- Choose the entry type Story Chief should use to create articles.
- Map the story Chief fields to your entry fields.
- Click on save configuration
If you want to publish in multiple languages, ensure that the languages that you create inside StoryChief use the same language code as in Craft.
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.
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'),