The CWP module comes with an extension that allows developers to augment the links with Web Government Standards compliant attributes and markup.
The following abilities are included:
- Adding a
rel="external"attributes to external links.
- Inserting file type and file size into file download links.
To use the feature, explicitly invoke the parser function within the template.
You can also chain it with other functions to achieve more complex outputs.
Note: this parser might not work as expected on fields not edited with HtmlEditorField, as it relies on the content being provided in this specific format.
The capability is built as a simple extension to
DBField. It is applied in
SilverStripe\ORM\FieldType\DBField: extensions: - CWP\Core\Extension\RichLinksExtension
It provides all fields with a