Hello,
I'm developing a CMS system where you can edit the mailtemplates for certain e-mails that are sent and I'm looking for a plugin that enables me to insert custom tags into the editor (not html tags but on the format [whatever]). Note that the content of the mailtemplate should be html it's just certain tags that I would like to have on that format.
For example I would like a button in the toolbar where the user clicks and is presented with a list of available tags, it could be something like FirstName, LastName, Email etc.
When a user selects FirstName and clicks "ok" the source that is generated should look like [FirstName]. It would be desirable if the tag itself was clickable when it was inserted and clicking it would bring up the "Custom tag"-plugin.
It would also be nice if one is in edit mode in ckeditor and a tag is inserted, that the brackets would be removed, thus only shown in the source. Perhaps the tag could be displayed with a background-color to indicate that it is infact a "Custom tag".
Has anyone created a similiar plugin or know of such a plugin? If I were to write my own, any good tips on a plug-in that I could base my plugin on?
Check these basic tutorials
Check these basic tutorials that describe creating CKEditor plugins and some of the concepts that you mentioned: http://docs.cksource.com/CKEditor_3.x/Tutorials
They were created for CKEditor 3.x, but most stuff should be identical in CKEditor 4.
You can also see the source code of the BBCode plugin for some hints.
In any case, good luck with the project and hope you will share your experience/ plugin code when you are done! This will be much appreciated by the community.
Documentation Manager, CKSource
See CKEditor 5 docs, CKEditor 4 docs, CKEditor 3 docs, CKFinder 3 docs, CKFinder 2 docs for help.
Visit the new CKEditor SDK for samples showcasing editor features to try out and download!