Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am using the rich text editor for a user to insert images. It has a macro attached to it to allow to insert flash.
When ever i insert a file whether it be image or flash, the rte automatically adds a
tag, which means that my content isnt flush to the screen.
I remove the
ttags from the html source editor from the RTE but once isave the content, the tag comes back.
Any thoughts how i can get rid of these
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 to for exampe you can use http://www.jspretty.com/ - If your editor does not provide this option 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 will see 19 results and it is the last result you need to edit.
You should be aware that making changes to core files they will of disappear if you decide to do an upgrade. Then you have to do the modification once again.
Hope this helps,
Hi Jason Denousse,
This is the well know issue with RTE.
What I would suggest you is that remove the paragraph from the view or controller using sub-string or any other method.
or you can use
Hope this helps.
Hi @Urvish, do you know if this was converted to V8. I Was looking at the Source code in the HtmlHelperRenderExtensions but can't find this method.
Thanks for your reply, however, I've looked on my server and do not have /umbraco/lib/tinymce as a directory and have searched for tinymce.min.js file and do not have that either.
I am using Umbraco v6.0.6 if that makes a difference.
However, would adding an entry to he TinyMCE.css work?
And Urvish, i can remove the paragraph from the view and controller, but it reappears once publishing.
Sorry to sound ignorant but where would i enter that line you have given me?
You can add this line in the View where you fetching the values from the RTE.
It doesn't matter that p tag reappears after publishing when you truncate that p tag from the RTE value.
At the end you will not see p tag in front end.
Means you have written a code to remove p tag in view that it doesn't matter p tag appears after publishing.
Your terminology is confusing me, when you say "View where you fetching the values from the RTE" are you talking about the css file, or the config file, or somewhere else?
I'm using TinyMCE v3 wysiwyg as the property editor for my RichText editor data type.
I tried adding "<config key="forced_root_block"></config>" to <customConfig> section of the TinyMceConfig.config bt this didnt work either, still seeing <p> tags.
May I ask what specific version of Umbraco you're using? The path Dennis mentioned in the first post should be correct and contain the tinymce.min.js if you're on Umbraco 7.x - If not then it's probably located in the /umbraco_client folder somewhere.
But if the approach Urvish suggests above does the trick for you then there is no need to modify this file. It has the downside that you'll need to do it again if you need to upgrade Umbraco. So if you can fix it another way then that's probably more ideal.
Just got curious now :)
I'm using version 6.0.6. I have 3 files, tiny_mce.js, tiny_mce_popup.js and tiny_mce_src.js.
I haven't used Urvish's solution yet as I am still unsure of where to enter the entry he has given men.
I'm using TinyMCE v3.
I am talking about the template that means the views that means the .cshtml file.
You can write code when you fetch values.
Like for Example,
We fetch title from the Content page inside template (View) like @Model.Title.
So likewise you can get the RTE value like @Model.PropertyValue.ToString() ---
So this value you need to pass to the @umbraco.library.RemoveFirstParagraphTag method.
Ultimately , you need to write below code to get property value with first paragraph tag removed which is added by default from RTE.
So , you do't need to do any change in .css or and any .js files.
And when I am writing the code lik @umbraco then it means it supposed to be written in the Template(VIEW).
Let me know if you still not able to understand. I can explain you with image.
I think i know what you mean now, however, my templates are all designed in aspx pages, for example, this is what my template looks like:
"<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
<umbraco:Item field="flash" runat="server" />
As you can see very simple page, the macro allows me to add in flash, or use the inesert image tool from the TinyMCE. However, the p tags still insert. I think you are perhaps using a different format of templating to myself.
Just to confirm - Yes you and urvish are rendering the content differently. You're not using macros - You're using umbraco:Item, which is not the same.
I just checked and it turns out my memory is not that bad :) In Umbraco versions lower than 7 the tinymce script is placed in the /Umbraco_Client/TinyMCE/ folder - There is a minified tinymce.js file, which is probably the one you need to look in.
You can also try changing the way you're rendering the flash by using a Razor macro instead. Then what urvish describes about should be possible however it might take a variation.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted