Copied to clipboard

Flag this post as spam?

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


  • Ayo Adesina 445 posts 1059 karma points
    Sep 25, 2014 @ 10:32
    Ayo Adesina
    0

    HTML editor VS Multiline Text Box

    Hey guys,

    I have created an umbraco website. In one of my document types one of the fields is HTML, I want to be able to put HTML in the backend of Umbraco and then pull that out on the front end.

    I'm using umbraco 7, I am currently putting the HTML in to a multiline Text Box, the text box is saving the HTML but when I try and put it out in the front end its printing the HTML code to the screen.

    What is the best way to do this, and if I want to have a HTML editor in the backend how do I do this, I don't see HTML editor as a datatype for a field.

    Any ideas?

  • Amalie Wowern 145 posts 274 karma points MVP c-trib
    Sep 25, 2014 @ 10:39
    Amalie Wowern
    0

    Use

    @Html.Raw(yourMultilineTextboxName)
    
  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Sep 25, 2014 @ 12:18
    Jeroen Breuer
    0

    You could also try this:

    @using Umbraco.Web;
    <div>@(Model.Content.GetPropertyValue<HtmlString>("alias"))</div> 

    Jeroen

  • 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