Try our conversational search powered by Generative AI!

Disable TinyMce in EPi 7.5

Vote:
 

hi

tinymce has alot of issues with our old epi 5 data.  

he removes and changes html accroding to EPi and tinymce state of mind,

i managed to cause tinymce to not validate any html but epi still does manipulation to the html.

1. can we disable the tinymce ? like in version 6 that i could select the old one (5)

2. can i create my own html editor with epi support ( links, images) ? is there a custom poroperty availble somewhere ?

3. can i "tell" epi to be less strict when parsing xhtml ? , an example is changing url to epi internal url even if i need the full url to be return in a json/asjx call ?

#114792
Dec 22, 2014 14:28
Vote:
 
<p>Hi Gilad,</p> <p>You can try and create a property which is not XHtmlString and instead a string and set the&nbsp;UIHint to Textarea</p> <pre class="brush:csharp;auto-links:false;toolbar:false" contenteditable="false">[UIHint(UIHint.Textarea)] public virtual string Heading { get; set; }</pre> <p></p> <p>Hope this helps!</p> <p>T</p>
#114800
Edited, Dec 22, 2014 17:55
Vote:
 
<p></p> <p>Regarding number 3, I wouldn't recommend storing the links as external. Instead you can rewrite the output before sending it. E.g.:</p> <pre class="brush:html;auto-links:false;toolbar:false" contenteditable="false">public static string RewriteUrlsToFriendly(this string input, bool absoluteUrls) { if (absoluteUrls) { input = Regex.Replace(input, "&lt;img(.*?)src=\"/", "&lt;img$1src=\"" + EPiServer.Web.SiteDefinition.Current.SiteUrl, RegexOptions.IgnoreCase); input = Regex.Replace(input, "&lt;a(.*?)href=\"/", "&lt;a$1href=\"" + EPiServer.Web.SiteDefinition.Current.SiteUrl, RegexOptions.IgnoreCase); } var toExternal = new FriendlyHtmlRewriteToExternal(UrlBuilder.RebaseKind.ToRootRelative); return toExternal.RewriteString( new UrlBuilder(SiteDefinition.Current.SiteUrl), new UrlBuilder(SiteDefinition.Current.SiteUrl), Encoding.UTF8, input); }</pre> <p></p> <p></p>
#114801
Dec 22, 2014 18:36
Vote:
 
<p>To write your own editor with full support for links and so on would be a hell of a job. Check out my blog post on how the editor is built up:</p> <p>http://world.episerver.com/blogs/Henrik-Fransas/Dates/2014/10/how-to-use-tinymce-the-episerver-way-in-a-custom-property/</p> <p>Insted you can easily extend the one EPiServer use and do your own parsing of the text so it works in the new editor, in part two of the blog post I show how to extend, read more here:</p> <p>http://world.episerver.com/blogs/Henrik-Fransas/Dates/2014/11/how-to-use-tinymce-in-a-custom-property-the-episerver-wayclean-version/</p> <p></p> <p></p>
#114834
Dec 23, 2014 17:38
Vote:
 
<p>After many change to the tinymce js configuration managed to get tinymce to receive everything i write down, but the probelms are EPi is stripping some html is find problems with.</p> <p>there is a request to the server&nbsp;<a href="http://localhost:8040/cms/cms/Stores/contentdata/75539_195379">http://localhost:8040/cms/cms/Stores/contentdata/75539_195379</a>&nbsp;that sent the correct xhtml</p> <p>but in the response it removes or changes the html.</p> <p></p> <p>for example&nbsp;</p> <p>a. an empty &lt;div&gt;&lt;/div&gt; that i use for icons is removed&nbsp;</p> <p>b.external address to an internal address is cahnged to an internal.</p> <p>This is the request to the server</p> <p><span><a href="http://localhost:8040/cms/cms/Stores/contentdata/75539_195379">http://localhost:8040/cms/cms/Stores/contentdata/75539_195379</a></span>&nbsp;</p> <p><span>in request - YOU CAN SEE THE correct link</span>&nbsp;</p> <p><span>properties: {,&hellip;}</span></p> <p><span>testXhtml: ""fsdfsdfsdfsdf&lt;br /&gt;gfdgdfgdfgfdg&lt;br /&gt;&lt;a href=\"<a href="https://www.goolge.com/">https://www.goolge.com\</a>" target=\"_blank\"&gt;linkOutside&lt;br /&gt;&lt;/a&gt; &lt;a href=\"<a href="http://localhost:8040/cellular/ServicesLobby/general/insurance_warrant_clear/">http://localhost:8040/cellular/ServicesLobby/general/insurance_warrant_clear/\</a>"&gt;linkoutsidetoInside&lt;/a&gt;\n&lt;div&gt;&lt;/div&gt;""</span></p> <p>&nbsp;</p> <p><span>in response from server it's clean the empty div + change the href ( localhost:8040/////</span>&nbsp;</p> <p><span>{}&amp;&amp;{"successful":true,"savedContentLink":"75539_195379","properties":[{"name":"testXhtml","value":"fsdfsdfsdfsdf&lt;br /&gt;gfdgdfgdfgfdg&lt;br /&gt;&lt;a href=\"<a href="https://www.goolge.com/">https://www.goolge.com\</a>" target=\"_blank\"&gt;linkOutside&lt;br /&gt;&lt;/a&gt; &lt;a href=\"/cms/CMS/Content/cellular/ServicesLobby/general/insurance_warrant_clear,,20571/?epieditmode=False\"&gt;linkoutsidetoInside&lt;/a&gt;\n","successful":true,"validationErrors":null,"committed":false}],"validationErrors":[]}</span></p> <p><span></span></p> <p><span>???</span></p> <p>&nbsp;</p>
#114840
Dec 23, 2014 22:05
Vote:
 
<p>the problem with Xhtml is that EPi backend does some mainpulation on the content he gets from the client.</p> <p></p> <p>i"m trying to create a xhtml editor with propertyLongstring and backing type so i can save anything.</p> <p>my 2nd approch is to find the location where Backend does the manipulation and removes it.</p> <p></p>
#114878
Dec 28, 2014 15:48
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.