I'd like to configure tinyMCE to NOT wrap blocks in <p> tags. I've read conflicting information about how to accomplish this, with the possibility that there's a bunch of tinyMCE files that aren't even used anymore. I see through chrome that there's a tinymce.js.min file being download with the site, but I can't find the source for that file.
Any pointers in the right direction would be very helpful!
If you go to the file system of your Umbraco installation and go it to the folder called Umbraco_Client, and in this folder you have to find the folder for the Tinymce3.
In there you will find the tiny_mce_src.js, open up the file and go to line number 13452. and remove the p in the quotes
I did see that, but I didn't know that it was the source of the min.js file. I had read in another post that it may have been leftover from previous versions of Umbraco and wasn't really used anymore. I will try and report back. Thanks!
If you go to /umbraco/lib/tinymce you will see the tinymce.min.js file in there.
To be able to make the change described you need to run the minified code through a prettifier - If your editor does not provide this option you can use http://www.jspretty.com/ and once the code is modfied you can copy/paste it into http://marijnhaverbeke.nl/uglifyjs to uglify it again. Make sure to search for "forcedrootblock"...I think you'll see 19 results and it seems it's the last result you need to edit.
Ok, so when that is said - You should be aware that making changes to core files is not advisable since they'll of course disappear if you decide to do an upgrade. Then you'll need to do the modification once again.
If it's an issue that should be fixed for good in the Umbraco core then please consider making a bug/feature report at the issue tracker at http://issues.umbraco.org/issues
Wow, I swore I didn't see the /umbraco/lib folder the first few times I looked. Thank you Jan! I was able to find the pertinent setting in the tinymce.min.js file, so I didn't need to pretty her up and ugly her down.
For those who wish to do the same thing, just search for:
forced_root_block:"p"
and change it to:
forced_root_block:""
This will keep tinymce from wrapping text in paragraph tags. I do not know the full implications of this setting, however, we required greater control over the markup and was comfortable removing this bit of formatting; the containing block level elements are set in our views, which I think makes it easier to edit. The "p" tags can become nightmarish with a novice editor.
I wouldn't call this a bug, just a setting. Which ideally should be easier to....set.
Well then maybe make a feature request for making the setting easier to configure? :)
It's actually already possible to edit a lot of tinymce related stuff in the /config/tinymceeditor.config file - Not sure about this particular setting though. There has been some changes in how it should be formatted and setup between 4/6 and 7 since the change to tinymce 4.
Yes, I just used the config/tinymceeditor.config file to allow additional elements in the editor, specifically script/noscript tags. So, the file clearly does SOMETHING, but it isn't clear what the extent of it's usefulness is. I will add a feature request for the ability to change any of the config settings that mce documents on their site.
How to alter TinyMCE in 7.1.8
I'd like to configure tinyMCE to NOT wrap blocks in <p> tags. I've read conflicting information about how to accomplish this, with the possibility that there's a bunch of tinyMCE files that aren't even used anymore. I see through chrome that there's a tinymce.js.min file being download with the site, but I can't find the source for that file.
Any pointers in the right direction would be very helpful!
Thanks,
Steph
Hi Steph,
Have you seen this http://scottsdevblog.com/2011/08/get-rid-of-those-pesky-p-tags-in-umbracos-tinymce-editor/
If you go to the file system of your Umbraco installation and go it to the folder called Umbraco_Client, and in this folder you have to find the folder for the Tinymce3.
In there you will find the tiny_mce_src.js, open up the file and go to line number 13452. and remove the p in the quotes
Hope this helps,
/Dennis
I did see that, but I didn't know that it was the source of the min.js file. I had read in another post that it may have been leftover from previous versions of Umbraco and wasn't really used anymore. I will try and report back. Thanks!
Hi Stephanie
If you go to /umbraco/lib/tinymce you will see the tinymce.min.js file in there.
To be able to make the change described you need to run the minified code through a prettifier - If your editor does not provide this option you can use http://www.jspretty.com/ and once the code is modfied you can copy/paste it into http://marijnhaverbeke.nl/uglifyjs to uglify it again. Make sure to search for "forcedrootblock"...I think you'll see 19 results and it seems it's the last result you need to edit.
Ok, so when that is said - You should be aware that making changes to core files is not advisable since they'll of course disappear if you decide to do an upgrade. Then you'll need to do the modification once again.
If it's an issue that should be fixed for good in the Umbraco core then please consider making a bug/feature report at the issue tracker at http://issues.umbraco.org/issues
Hope this helps.
/Jan
Wow, I swore I didn't see the /umbraco/lib folder the first few times I looked. Thank you Jan! I was able to find the pertinent setting in the tinymce.min.js file, so I didn't need to pretty her up and ugly her down.
For those who wish to do the same thing, just search for:
forced_root_block:"p"
and change it to:
forced_root_block:""
This will keep tinymce from wrapping text in paragraph tags. I do not know the full implications of this setting, however, we required greater control over the markup and was comfortable removing this bit of formatting; the containing block level elements are set in our views, which I think makes it easier to edit. The "p" tags can become nightmarish with a novice editor.
I wouldn't call this a bug, just a setting. Which ideally should be easier to....set.
Thanks again,
Steph
Hi Steph
Happy that it worked :)
Well then maybe make a feature request for making the setting easier to configure? :)
It's actually already possible to edit a lot of tinymce related stuff in the /config/tinymceeditor.config file - Not sure about this particular setting though. There has been some changes in how it should be formatted and setup between 4/6 and 7 since the change to tinymce 4.
Happy umbracoing!
/Jan
Yes, I just used the config/tinymceeditor.config file to allow additional elements in the editor, specifically script/noscript tags. So, the file clearly does SOMETHING, but it isn't clear what the extent of it's usefulness is. I will add a feature request for the ability to change any of the config settings that mce documents on their site.
Thanks!
Steph
is working on a reply...