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 430 posts 1023 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 144 posts 273 karma points c-trib
    Sep 25, 2014 @ 10:39
    Amalie Wowern
    0

    Use

    @Html.Raw(yourMultilineTextboxName)
    
  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x 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

Please Sign in or register to post replies

Write your reply to:

Draft