Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Karima 2 posts 92 karma points
    Jun 05, 2019 @ 10:36
    Karima
    0

    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.

  • Brandon Osborne 37 posts 160 karma points c-trib
    Jun 06, 2019 @ 10:36
    Brandon Osborne
    1

    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.

  • Karima 2 posts 92 karma points
    Jun 06, 2019 @ 10:46
    Karima
    100

    Hi Brandom,

    Thank you for your response, I found the solution :

    var myString = Model.MacroParameters["Introduction"].ToString();
      @Html.Raw(HttpUtility.HtmlDecode(myString))
    
  • Erik W 4 posts 83 karma points
    Jun 27, 2019 @ 10:41
    Erik W
    0

    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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies