Help! TinyMCE is putting HTML HEAD and BODY tags upon save and mangling img tag src Options
robm
Posted: Tuesday, January 29, 2008 11:49:01 PM
Rank: Enthusiast

Joined: 6/22/2007
Posts: 29
Sorry if this is a duplicate message as I have now sent it 4 times without it showing up.

Hi All,
We are on version 3.04.
When I save a tinymce edit and look in the umbraco.config file the saved TinyMCE content now contains HTML, HEAD and BODY tags.

Why is the TinyMCE output adding the HTML, HEAD and BODY tags? This did not happen in version 3.02. And of course because of this it also adds multiple HEAD and BODY tags to the resolved page (one for each TinyMCE control).
Also it adding a Tidy element (<meta name="generator" content=
"HTML Tidy for Windows (vers 1st May 2002)">)? Did some config parameter get changed? Has anyone else seen this behavior.

Also and maybe its related, I am also getting strange behavior when adding images from media picker. If I add a couple of images into a TinyMCE with Media Picker and save and publish the page it will often (but not always) strip out part of the img src URL leaving a invalid tag. Sometimes if I try and save it after this it will throw the following error:

Exception Details: System.FormatException: Input string was not in a correct format.

Stack Trace:

FormatException: Input string was not in a correct format.
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +2725283
System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +102
umbraco.editorControls.tinymce.tinyMCEImageHelper.cleanImages(String html) +1085
umbraco.editorControls.tinymce.TinyMCE.Save() +432
umbraco.controls.ContentControl.saveClick(Object Sender, ImageClickEventArgs e) +80
umbraco.controls.ContentControl.savePublish(Object Sender, ImageClickEventArgs e) +21
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +105
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

Thanks for any help.
Rob
Arjandb
Posted: Wednesday, January 30, 2008 4:05:29 PM
Rank: Devotee

Joined: 8/31/2007
Posts: 50
Location: Utrecht NL
It's not TinyMCE but Tidy (a html cleanup dll) that's doing this.

You should set show-body-only: yes in /config/tidy.cfg

You can also diable Tidy at all in config/UmbracoSettings.config:

<TidyEditorContent>False</TidyEditorContent>

See this thread:
http://forum.umbraco.org/misc/how-to-configure-tidy-html-output
robm
Posted: Wednesday, January 30, 2008 7:34:10 PM
Rank: Enthusiast

Joined: 6/22/2007
Posts: 29
Thanks Arjan, that did it:D. Turns out that the tidy.cfg was missing all together. Not only did it solve the HEAD, BODY and HTML tags inclusion but it also stopped the img managling and the DLL error.
Frustrating having to spend many hours because of a missing config file, but at least its solved that to you.

Cheer
Rob
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.