Copied to clipboard

Flag this post as spam?

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


  • Adrian Wu 53 posts 266 karma points
    Aug 21, 2018 @ 01:38
    Adrian Wu
    0

    how to get RTE value in Razor view ?

    Hi thanks for this amazing backoffice-extension.

    if the property editor is textbox , i can get the value like this : item.GetValue<string>("postTitle")

    but if it is a RTE , could some one please tell me how to get the value?

    Thanks,

    A

  • Shawn Calvert 31 posts 196 karma points
    Aug 22, 2018 @ 02:06
    Shawn Calvert
    101

    I don't know if this is what you are looking for, but this is how I'm getting the raw HTML values out of an RTE:

    if (item.HasValue("override")){@Html.Raw(item.GetProperty("override").ToString())}
    
  • Adrian Wu 53 posts 266 karma points
    Aug 22, 2018 @ 03:34
    Adrian Wu
    0

    Hi Shawn , thx for the advise.

    I am using this item.GetValue<dynamic>("itemName") to get it now .

    Thanks all the same,

    Best,

    A

  • Craig 4 posts 74 karma points
    Nov 12, 2020 @ 09:41
    Craig
    0

    I used Shawn's example but just changed one thing on it and it worked for me.

    @if (Model.HasValue("override")){@Html.Raw(Model.Value("override").ToString())}
    

    Hopefully this might help others.

Please Sign in or register to post replies

Write your reply to:

Draft