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 added a parameter of type "RTE" in my Macro. but I can't get its value correctly. In the cshtml file, I add this to get the value of the parameter:
@Html.Raw(TemplateUtilities.ParseInternalLinks(Model.MacroParameters["Introduction"].ToString(), Current.UmbracoContext.UrlProvider))
but the result is not in html:
kgkgkkgkg kggkkg<br />jjjj.
Hello There, Karima,
I would say to first look at the source in your RTE and make sure the HTML isn't coming out HTMLEncoded (i.e. <br /> ). If it is correct it in the HTML or change your code to:
@Html.Raw(Server.HtmlDecode(TemplateUtilities.ParseInternalLinks(Model.MacroParameters["Introduction"].ToString(), Current.UmbracoContext.UrlProvider)))
I've seen the RTE occasionally do this and mess up the results that I'm expecting. Let me know if that fixes your issue or if the problem persists.
Hi Brandom,
Thank you for your response, I found the solution :
var myString = Model.MacroParameters["Introduction"].ToString(); @Html.Raw(HttpUtility.HtmlDecode(myString))
Hi, how did you add the RTE in V8?
I tried to use this guide but cant get it to work: https://our.umbraco.com/forum/templates-partial-views-and-macros/82089-tinymce-as-macro-parameter
To Render RTE Content passed by Macro-Paraemter and also render internal links! use this code:
@using Umbraco.Web.Templates; @using Umbraco.Web.Composing; @inherits Umbraco.Web.Macros.PartialViewMacroPage @{ HtmlLocalLinkParser htmlLocalLinkParser = new HtmlLocalLinkParser(Current.UmbracoContextAccessor); string text = Model.MacroParameters["textFromRTE"].ToString(); } @Html.Raw(htmlLocalLinkParser.EnsureInternalLinks(Server.HtmlDecode(text)))
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Macro + Rte
I added a parameter of type "RTE" in my Macro. but I can't get its value correctly. In the cshtml file, I add this to get the value of the parameter:
@Html.Raw(TemplateUtilities.ParseInternalLinks(Model.MacroParameters["Introduction"].ToString(), Current.UmbracoContext.UrlProvider))
but the result is not in html:
kgkgkkgkg kggkkg
<br />jjjj.
Hello There, Karima,
I would say to first look at the source in your RTE and make sure the HTML isn't coming out HTMLEncoded (i.e. <br /> ). If it is correct it in the HTML or change your code to:
I've seen the RTE occasionally do this and mess up the results that I'm expecting. Let me know if that fixes your issue or if the problem persists.
Hi Brandom,
Thank you for your response, I found the solution :
Hi, how did you add the RTE in V8?
I tried to use this guide but cant get it to work: https://our.umbraco.com/forum/templates-partial-views-and-macros/82089-tinymce-as-macro-parameter
To Render RTE Content passed by Macro-Paraemter and also render internal links! use this code:
is working on a reply...