Copied to clipboard

Flag this post as spam?

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

  • John Churchley 27 posts 172 karma points
    Mar 19, 2014 @ 23:28
    John Churchley

    StripHtml and Truncate gone in V7?

    Anyone know if the StripHtml and Truncate methods have gone in V7?

  • Dennis Aaen 4468 posts 18026 karma points admin hq c-trib
    Mar 19, 2014 @ 23:56
    Dennis Aaen

    Hi John,

    Here is an example how you could use StripHtml and Truncate methods in Umbraco 7.


    @Umbraco.Truncate(CurrentPage.bodyText, 122)



    Hope this helps,


  • John Churchley 27 posts 172 karma points
    Mar 20, 2014 @ 00:04
    John Churchley

    Thanks Dennis!

  • Streety 358 posts 568 karma points
    May 15, 2014 @ 09:53

    yep the bible razor Node cheat sheet needs updating.

    So @library.Trancate is now @Umbraco.Truncate.


    And a few others.

  • Carlos Mosqueda 221 posts 366 karma points
    Oct 09, 2014 @ 17:53
    Carlos Mosqueda

    So if there is a truncate in the middle of an IMG tag, would this still strip the HTML or would we need to put in exceptions for the IMG tags and such.



  • Thomas Higginbotham 4 posts 80 karma points
    Apr 17, 2019 @ 20:48
    Thomas Higginbotham

    Seems to have changed again in Umbraco 8. They're now HTML helper extensions.

    @Umbraco.Truncate() is now @Html.Truncate()

  • Alan Mitchell 54 posts 270 karma points c-trib
    Jul 22, 2019 @ 13:01
    Alan Mitchell

    For anyone else searching here for migrations of code to V8, it's a similar pattern for StripHtml. Looks like various text functions have moved from the bulging swiss army knife of UmbracoHelper into HtmlHelper, so


    is now

Please Sign in or register to post replies

Write your reply to: