wedevelopnl/silverstripe-highlights

Silverstripe module to add shortcode highlights for DB strings.

Installs: 6

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 7

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

1.0.0 2024-03-26 14:27 UTC

This package is auto-updated.

Last update: 2024-10-26 17:19:09 UTC


README

This module creates a .Highlight method on all SS DBStrings to provide the ability to highlight custom texts by placing it between shortcodes that are configurable by yourself.

Requirements

  • See composer.json requirement

Installation

  • composer require wedevelopnl/silverstripe-highlights

Next, you'll need to run a dev/build with a flush=all to allow this module to work properly.

License

See License

Maintainers

Configuration

SilverStripe\ORM\FieldType\DBString:
    shortcode_start: '['
    shortcode_end: ']'
    css_class_name: 'highlight'

Example

Input

This is a [large] content string which outputs HTML around the word 'large'.

Output

This is a <span class="highlight">large</span> content string which outputs HTML around the word 'large'.

Development and contribution

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. See read our contributing document for more information.