Skip to content

Get started with Quant and Drupal

Quant supports Drupal 7, 10 and 11. Release line 1.x is for Drupal 10, release line 2.x is for Drupal 11, and 7.x-1.x is for Drupal 7. Current releases do not support Drupal 9. The codebases are maintained in GitHub and are synced to the Drupal.org QuantCDN project when releases are created. As such, the Drupal.org repo can lag behind the GitHub repo slightly. Issues, feature requests, and pull requests can be raised in GitHub or Drupal.org.

  1. Download the Quant module via Drupal.org or:
  • Drupal 7: Drush (drush dl quantcdn)
  • Drupal 10, 11: Composer (composer require drupal/quantcdn)
  1. Install the module (drush en quant) which will also install the quant_api submodule.
  2. Recommended: For better performance, update your settings.php file with:
$settings['queue_service_quant_seed_worker'] = 'quant.queue_factory';
  1. Visit the Configuration > Quant admin page:
  • Drupal 7: /admin/config/services/quant
  • Drupal 10, 11: /admin/config/quant
  1. Ensure “Track content changes” is enabled, and you have all entities enabled that should be automatically pushed to Quant when changes are made.
  2. Set your “Webserver URL” to the local webserver loopback address (e.g. http://localhost). Note, this usually starts with http rather than https.
  3. Set your website domain as the “HTTP Host header” (e.g. www.example.com).
  4. Check other options on the main configuration page to see if there are other settings you want to update.
  5. Navigate to the “API” tab (/admin/config/development/quant/api) and enter your organization, project, and token details. These can be found on the Integrations page in the Quant Dashboard. Use the project “API name” for the project, and the project token (not a dashboard API token).
  6. After filling in your API details, you should see a “Successfully connected to …” message at to the top of the page. If not, check your “API” tab details and compare them against the information on the Integrations page in the Dashboard and update as needed.
  7. If you are still experiencing issues, create a support ticket, so we can help you get set up.

If you are using the Drupal Shield module (or have other basic authentication enabled on your webserver), then ensure you pass in the username and password in the “Webserver URL” field.

For example if you have username, user, and password, pass, then the Webserver URL value may look like this:

http://user:pass@localhost

The “API Endpoint” field is read-only in the form. Enter the host only, without /v1: the module adds /v1 to every request. The default is https://api.quantcdn.io. On QuantGov (https://dash.quantgov.cloud) set the endpoint to https://api.quantgov.cloud:

drush config:set quant_api.settings api_endpoint https://api.quantgov.cloud

You can also set the connection values in settings.php, for example to read the token from an environment variable. The form then shows an “overridden” warning for each value.

$config['quant_api.settings']['api_endpoint'] = 'https://api.quantgov.cloud';
$config['quant_api.settings']['api_account'] = getenv('QUANT_CUSTOMER');
$config['quant_api.settings']['api_project'] = getenv('QUANT_PROJECT');
$config['quant_api.settings']['api_token'] = getenv('QUANT_TOKEN');

Quant fetches each page with a POST to the “Webserver URL” and sends the “HTTP Host header” as Host. It does not fetch the public domain. If Drupal answers “The provided host name is not valid for this server”, add the “HTTP Host header” value to $settings['trusted_host_patterns']. A command that runs without a web server, such as a one-off container, cannot push content.

With “Track content change” on, saving a published node, taxonomy term or redirect pushes it at the end of the request. Unpublishing the default revision of a node, or deleting an entity, unpublishes the page in Quant. Draft revisions are not pushed while “Disable content drafts” is on (the default).