Contents
You can do this using the getContent() method from the TinyMCE API. Let’s say you have initialized the editor on a textarea with id=”myTextarea” . First access the editor using that same id, then call getContent() . This will return the content in the editor marked up as HTML.
How do you remove the P tag from TinyMCE editor?
replace(/^\/,””). replace(/\<\/p\>$/,””); Here you are removing the beginning and ending p tag of the whole TinyMCE HTML when you display it. Doesn’t mess with other p tags or the TinyMCE config.
How do you Reinit Tinymce?
Use tinymce. remove() method to remove TinyMCE editor from the HTML element and again call tinymce. init() on the selector to reinitialize.
How do I load Tinymce?
Self-Hosted Install
- Step 1: Download the Self-hosted package. If you’d rather download and install the script manually, get the package from TinyMCE Downloads.
- Step 2: Include the TinyMCE script.
- Step 3: Initialize TinyMCE as part of a web form.
- Step 4: Saving content with a form POST.
How to get content and set content in TinyMCE?
So here’s a brief guide on the relevant TinyMCE API methods, as well as some of the other commonly asked questions, like how to set content on initialization, and how to get the content without any HTML tags.
How to get the input of a TinyMCE editor when using on the front-end?
I am using it in the front end and want to be able to save whatever the user has typed into the TinyMCE to a database but cannot find the best way to capture that value. tinyMCE.activeEditor.getContent (); – This one seems to only get the value of the visual editor so if I’m in the HTML editor and make changes and then save, they aren’t picked up.
What do you need to know about TinyMCE for CMS?
When you’re using TinyMCE in your apps for users to edit content previously stored somewhere else, like in a CMS, you’ll need a way to populate the editor with that content. You can do this using the setContent () method from the TinyMCE API.
Are there any plugins that come free with TinyMCE?
Check out the PowerPaste plugin. There’s an Autosave plugin that comes free with TinyMCE to save your users the frustration of losing their work based on connectivity or other issues outside their control. Not already using TinyMCE on the cloud?