Use div tag as a default instead of paragraph in tinymce
Asked Answered
F

1

9

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.

Footpace answered 15/12, 2016 at 8:44 Comment(1)
https://mcmap.net/q/1172064/-tinymce-with-div-tagPeters
T
19

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

Thermoscope answered 15/12, 2016 at 8:52 Comment(1)
Thank you. This is exactly what I was looking for!Scarabaeoid

© 2022 - 2024 — McMap. All rights reserved.