symbiote / silverstripe-prose-editor
A wysiwyg editor based on prose mirror
Installs: 361
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 9
Language:JavaScript
Type:silverstripe-vendormodule
Requires
- silverstripe/framework: ^4.0
Requires (Dev)
- phpunit/phpunit: ^5.7
- squizlabs/php_codesniffer: ^3.0
- dev-master / 1.4.x-dev
- 1.4.1
- 1.4.0
- 1.3.8
- 1.3.7
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.0
- dev-dependabot/npm_and_yarn/editor/minimist-1.2.8
- dev-dependabot/npm_and_yarn/editor/express-4.18.2
- dev-dependabot/npm_and_yarn/editor/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/editor/css-what-2.1.3
- dev-dependabot/npm_and_yarn/editor/eventsource-1.1.1
- dev-dependabot/npm_and_yarn/editor/url-parse-1.5.10
- dev-dependabot/npm_and_yarn/editor/follow-redirects-1.14.8
- dev-dependabot/npm_and_yarn/editor/ajv-6.12.6
- dev-dependabot/npm_and_yarn/editor/node-sass-7.0.0
- dev-feature-text-align
- dev-feature-columns
This package is auto-updated.
Last update: 2024-11-04 07:21:53 UTC
README
Provides a wysiwyg editor for HTMLText content fields.
Combined with the frontend authoring module, provides in-place page editing capability
Composer Install
composer require symbiote/silverstripe-prose-editor:~1.0
Requirements
- SilverStripe 4.1+
Quick Start
Create and use ProseEditorField where you would otherwise use HtmlEditorField
Documentation
- Markdown-like shortcuts for formatting and creating lists, eg strike, bold, inline code
- Table editing
- Image paste and upload,
- Insert images from the CMS
- Insert page links from the CMS
- Creating new pages using square brackets/round brackets, [{page name}]({url-segment}]. You can leave url-segment empty, and one will be automatically created (requires the frontend-authoring module)
Shortcodes
Add the following to your _config.php if you'd like some additional shortcodes made available
ShortcodeParser::get('default')->register('show_field', array(ProseShortcodes::class, 'show_field_shortcode'));
ShortcodeParser::get('default')->register('listing', array(ProseShortcodes::class, 'listing_content'));
ShortcodeParser::get('default')->register('workflow_tasks', array(ProseShortcodes::class, 'workflow_tasks'));
ShortcodeParser::get('default')->register('random_item', array(ProseShortcodes::class, 'random_item'));
ShortcodeParser::get('default')->register('userform', array(ProseShortcodes::class, 'userform'));
- show_field(field, args) : Displays a field from the 'context' object, typically the currently viewed page.
- field: The field to display; can be in dotted notation for relationship traversal, ie Team.Title
- args: Comma separated list of arguments to pass when resolving the value
- listing(page_id, source_id) : Requires the ListingPage module, lists out content
- page_id: The listing page to render
- source_id: The source of the listing. Pass in 'me' to refer to the current page
- workflow_tasks: Lists out the current user's workflow tasks
- random_item: Gets a random page from the last 50 edited pages
- userform(form_id): Display the content of the userform from ID form_id
Quick Start
Where you'd normally use an HTMLEditorField, use ProseEditorField
instead.
Usage
To enable or disable menu items, use disableMenuItem($name)
and the correlation
enableMenuItem
. Menu items available are
insertlink
insertimage
bulletlist
orderedlist
quote
paragraph
pre
hr
table
shortcode
viewsource
You can also toggle inserting internal CMS links using disableSetting('linkSelector', 'internal')