Download the PHP package ndm2/ckeditor-placeholder-elements without Composer
On this page you can find all versions of the php package ndm2/ckeditor-placeholder-elements. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ndm2/ckeditor-placeholder-elements
More information about ndm2/ckeditor-placeholder-elements
Files in ndm2/ckeditor-placeholder-elements
Package ckeditor-placeholder-elements
Short Description A CKEditor plugin that adds support for predefined placeholder elements.
License MIT
Homepage https://github.com/ndm2/ckeditor-placeholder-elements
Informations about the package ckeditor-placeholder-elements
CKEditor Placeholder Elements Plugin
This is a CKEditor plugin that adds support for predefined placeholder elements.
What's it good for?
Well, in case you want the user to be able to use placeholders from a predefined collection, there you go... actually it's pretty much for my own specific use, but if it fits your needs, have fun with it.
Requirements
This plugins requires CKEditor 4.3+ and the following plugins:
How to use?
Installation
You can either
-
use npm (and copy the files into
ckeditor/plugins/placeholder_elements/) -
clone or download and unpack the repository into
ckeditor/plugins/placeholder_elements/ - or use Composer (optionally in combination with a custom directory installer like for example mnsami/composer-installer-plugin)
If you can't install the plugin directly in the CKEditor plugin folder, use
CKEDITOR.plugins.addExternal() to
point the editor to the directory where you've placed the plugin.
Configuration
Include the name of the plugin in the ckeditor extraPlugins option:
By default the UI element is appended to the insert toolbar.
In case you want to place it manually,
use PlaceholderElements as the identifier.
The following options are available for configuration:
Modifying the list of placeholders at runtime
The available placeholders can be modified at runtime using the instance of the PlaceholdersCollection class
associated with the corresponding plugin instance.
Changes made to this collection are automatically being applied to the editor UI and content.
Add a new placeholder
Add a new placeholder to an existing group (or append a new group in case it doesn't exist yet)
Remove the third placeholder
Modify an existing placeholder
For more check out the PlaceholdersCollection class
source.
Note that applying multiple consecutive changes can lead to flickering, due to the nature of change events causing
UI and content updates. Make use of the PlaceholdersCollection.batchChanges() method to avoid this, changes made from
the callback passed to this method will cause only a single change event to be fired afterwards.
Issues
Please use the issue tracker to report problems.
License
Licensed under The MIT License.