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 ?
<p>Hi Gilad,</p>
<p>You can try and create a property which is not XHtmlString and instead a string and set the 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>
<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, "<img(.*?)src=\"/", "<img$1src=\"" + EPiServer.Web.SiteDefinition.Current.SiteUrl, RegexOptions.IgnoreCase);
input = Regex.Replace(input, "<a(.*?)href=\"/", "<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>
<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>
<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 <a href="http://localhost:8040/cms/cms/Stores/contentdata/75539_195379">http://localhost:8040/cms/cms/Stores/contentdata/75539_195379</a> that sent the correct xhtml</p>
<p>but in the response it removes or changes the html.</p>
<p></p>
<p>for example </p>
<p>a. an empty <div></div> that i use for icons is removed </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> </p>
<p><span>in request - YOU CAN SEE THE correct link</span> </p>
<p><span>properties: {,…}</span></p>
<p><span>testXhtml: ""fsdfsdfsdfsdf<br />gfdgdfgdfgfdg<br /><a href=\"<a href="https://www.goolge.com/">https://www.goolge.com\</a>" target=\"_blank\">linkOutside<br /></a> <a href=\"<a href="http://localhost:8040/cellular/ServicesLobby/general/insurance_warrant_clear/">http://localhost:8040/cellular/ServicesLobby/general/insurance_warrant_clear/\</a>">linkoutsidetoInside</a>\n<div></div>""</span></p>
<p> </p>
<p><span>in response from server it's clean the empty div + change the href ( localhost:8040/////</span> </p>
<p><span>{}&&{"successful":true,"savedContentLink":"75539_195379","properties":[{"name":"testXhtml","value":"fsdfsdfsdfsdf<br />gfdgdfgdfgfdg<br /><a href=\"<a href="https://www.goolge.com/">https://www.goolge.com\</a>" target=\"_blank\">linkOutside<br /></a> <a href=\"/cms/CMS/Content/cellular/ServicesLobby/general/insurance_warrant_clear,,20571/?epieditmode=False\">linkoutsidetoInside</a>\n","successful":true,"validationErrors":null,"committed":false}],"validationErrors":[]}</span></p>
<p><span></span></p>
<p><span>???</span></p>
<p> </p>
<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>
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 ?