Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • stephanie 52 posts 133 karma points
    Oct 23, 2014 @ 20:25
    stephanie
    0

    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

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Oct 23, 2014 @ 20:43
    Dennis Aaen
    0

    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

  • stephanie 52 posts 133 karma points
    Oct 23, 2014 @ 20:45
    stephanie
    0

    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!

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Oct 23, 2014 @ 22:11
    Jan Skovgaard
    100

    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

  • stephanie 52 posts 133 karma points
    Oct 24, 2014 @ 03:21
    stephanie
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Oct 24, 2014 @ 07:38
    Jan Skovgaard
    0

    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

  • stephanie 52 posts 133 karma points
    Oct 26, 2014 @ 16:49
    stephanie
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft