I'm new at joomla and currently using Joomla version 3.6. Is there a way to set the tinymce editor to use div tag as a default instead of paragraph? Any answer would be appreciated, Thanks a lot.
The <div> tag can NOT be inside <p> tag, because the paragraph will be broken at the point, where the <div> tag is entered. To apply styles inside a paragraph use <span> tag, which is used with inline elements.
The TinyMCE getContent and setContent methods You can do this using the getContent() API method. Let's say you have initialized the editor on a textarea with id=”myTextarea”. This will return the content in the editor marked up as HTML.
To change the default font family, size, or color in the TinyMCE editor, we recommend using content_css or content_style (or a combination of both) depending on your use case. TinyMCE is shipped with a default CSS that determines what the font and everything else looks like in the editor itself.
By default, it has basic markdown patterns. There are three types of patterns: inline , block , and replacement patterns. Inline patterns have a start and an end text pattern whereas the block and replacement patterns only have a start .
You have to init tinymce with forced-root-block: 'div'
.
tinymce.init({
// ...
forced_root_block : 'div'
});
If you set this option to false it will never produce p tags on enter, or, automatically it will instead produce br elements and Shift+Enter will produce a p. — documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With