wernerkrauss / ss-stringfield-replace
Extension for replacing symbols to html in DBString subclasses
Installs: 167
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:silverstripe-vendormodule
Requires
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is auto-updated.
Last update: 2024-11-24 19:40:40 UTC
README
This module provides a simple search/replace functionality for DBString derived fields (Text, HTMLText, Varchar) in Silverstripe CMS 4.
Requirements
- Silverstripe > 4
Installation
Install this package using composer
composer require wernerkrauss/ss-stringfield-replace ^0.1
Features:
You can define maps to replace in your text field. By default it replaces:
(c)
becomes©
(r)
becomes<sup>®</sup>
(tm)
becomes<sup>™</sup>
|
becomes<br>
This can be used in templates using the Replace
method, e.g.
<h1>$Title.Replace</h1>
Configuration
You can add your own replacements by modifying SilverStripe\ORM\FieldType\DBString.replacements
config