Get Started

Configuration

You can customise Social Poster’s settings using a PHP configuration file. This is optional: each setting has a default, so you only need to include the values you want to change.

To override a setting, create social-poster.php in your Craft project’s /config directory and return an array of setting names and values. For example, the following will change the name displayed in the control panel:

<?php

return [
    'pluginName' => 'Social Poster Tools',
];

All other settings keep their defaults. Add any further settings you want to change to the same array. The options below explain the available settings and their defaults. You can also manage these settings in the control panel under Settings → Social Poster.

Configuration Options

pluginName

If you wish to customise the plugin name.

hasCpSection

Whether to have the plugin pages appear on the main CP sidebar menu.

enabledSections

An array of section UIDs to enable social poster on. Use '*' for all.

redirectUri

Optionally override the OAuth redirect URI for detached or multi-domain setups. This applies to all accounts.

  • accounts - A collection of options for each account.

Redirect URI Override

By default, Social Poster builds its callback URI from the social-poster/auth/callback route. If you need a different callback URI, such as for detached domains or an /actions/... callback, set redirectUri at the plugin level.

'redirectUri' => 'https://craft.example.com/actions/social-poster/auth/callback',

Accounts

Supply your client configurations as per the below. The key for each item should be the account handle.

return [
    '*' => [
        // ...
        'accounts' => [
            'facebook' => [
                'enabled' => true,
                'autoPost' => false,
                'clientId' => '••••••••••••••••••••••••••••',
                'clientSecret' => '••••••••••••••••••••••••••••',

                // Add in any additional OAuth scopes
                'scopes' => [
                    'business_management',
                ],

                // Add in any additional OAuth authorization options, used when redirecting
                // to the provider to start the OAuth authorization process
                'authorizationOptions' => [
                    'extra' => 'value',
                ],
            ],
            'linkedIn' => [
                'clientId' => '••••••••••••••••••••••••••••',
                'clientSecret' => '••••••••••••••••••••••••••••',
            ],
            'twitter' => [
                'clientId' => '••••••••••••••••••••••••••••',
                'clientSecret' => '••••••••••••••••••••••••••••',
            ],
        ],
    ],
];