RTE on CSHTML page has locallink:umb:// in the links
Hi,
I am using an RTE in the Grid in the latest version of umbraco CMS and when the page is published the links from the Text editor have links like:
<a data-udi="umb://document/a8990cb2424346b9a12041a30e3ea541" href="/{localLink:umb://document/a8990cb2424346b9a12041a30e3ea541}" title="Home">And a super link</a>
I am using @Html.Raw(rtesource) - do i need to do anything else?
I have seen a few old links to possible fixes but none work now.
It should work out of the box, as I've used the full path of the TemplateUtilities class. From what I can tell, the class is located in umbraco.dll.
A cause for the error could be if you have a folder somewhere in your solution called Umbraco. In that case, you could try something like below instead (the difference being that the full class name is now prefixed with global::):
string html = global::Umbraco.Web.Templates.TemplateUtilities.ParseInternalLinks(rteGridValue, UmbracoContext.Current.UrlProvider);
@Html.Raw(html)
Just stumpled upon this, for future reference if people have the same reference issue, the reason is "Umbraco" is a reference for UmbracoHelper in most Umbraco Contexts, which results in the error Jonathan describes.
Instead just reference Umbraco.Web.Templates and use "TemplateUtilities.ParseInternalLinks()" to invoke the method.
@using Umbraco.Web.Templates
string html = Templates.TemplateUtilities.ParseInternalLinks(rteGridValue, UmbracoContext.Current.UrlProvider);
@Html.Raw(html)
RTE on CSHTML page has locallink:umb:// in the links
Hi,
I am using an RTE in the Grid in the latest version of umbraco CMS and when the page is published the links from the Text editor have links like:
I am using @Html.Raw(rtesource) - do i need to do anything else?
I have seen a few old links to possible fixes but none work now.
Thanks
Jon
Hi Jonathan,
It should work if you put the value through the
ParseInternalLinks
method:I have tried Umbraco.Web.Templates.TemplateUtilities.ParseInternalLinks but it says it cant find Web in Umbraco - what do I need to reference?
It should work out of the box, as I've used the full path of the
TemplateUtilities
class. From what I can tell, the class is located inumbraco.dll
.A cause for the error could be if you have a folder somewhere in your solution called
Umbraco
. In that case, you could try something like below instead (the difference being that the full class name is now prefixed withglobal::
):Just stumpled upon this, for future reference if people have the same reference issue, the reason is "Umbraco" is a reference for UmbracoHelper in most Umbraco Contexts, which results in the error Jonathan describes.
Instead just reference Umbraco.Web.Templates and use "TemplateUtilities.ParseInternalLinks()" to invoke the method.
Hi,
Thank you so much - this works like a charm.
Thanks again for all your help,
Jon
is working on a reply...