Get Started

Configuration

You can customise Doxter’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 doxter.php in your Craft project’s /config directory and return an array of setting names and values. For example, the following will disable automatic heading anchors:

<?php

return [
    'addHeaderAnchors' => false,
];

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 many of these settings in the control panel under Settings → Doxter.

Configuration Options

shortcodes

Maps shortcode names to site template paths. Template paths are relative to the Craft project’s templates directory. Doxter includes opt-in starter templates for audio, image and video shortcodes; follow the shortcode setup instructions to copy, map and verify them.

codeBlockSnippet

Text to wrap code blocks for syntax highlighting.

allowUnsafeHtml

Whether Doxter should return parsed HTML without purification. Leave this disabled for content written by editors or received from front-end forms. Enable it only when every source string and shortcode parameter is controlled by a developer who is trusted to add executable markup to the site.

This setting is available only in config/doxter.php or as a per-call parsing option, so changing the output trust policy remains a developer decision.

purifierConfig

Configuration passed to Craft’s HTML purifier. Doxter enables HTML IDs so linkable headings continue to work. Add narrowly scoped allowances here when trusted shortcode templates need markup that the default purifier removes.

For example, this configuration permits Vimeo player iframes while continuing to purify the rest of the generated HTML:

<?php

return [
    'purifierConfig' => [
        'HTML.SafeIframe' => true,
        'URI.SafeIframeRegexp' => '%^https://player.vimeo.com/video/%',
    ],
];

Like allowUnsafeHtml, this setting is available only in config/doxter.php or as a per-call parsing option.

addHeaderAnchors

Whether to enable header anchor parsing.

addHeaderAnchorsTo

Set which headers to make linkable.

startingHeaderLevel

Set the starting header level (as a number, 1-6).

addTypographyHyphenation

Whether to add typography hyphenation.

addTypographyStyles

Whether to add typography styles.

parseReferenceTags

Whether to parse reference tags.

parseShortcodes

Whether to parse shortcodes.