Copied to clipboard

Flag this post as spam?

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


  • Christopher Seely 8 posts 29 karma points
    Aug 05, 2015 @ 14:27
    Christopher Seely
    0

    Truncated Text

    Hi,

    I have a site with a news feed. It is then placed in the usual news 'widget' to create a mini feed.

    The feed has the following code to display the body text:

    @Umbraco.Truncate(@item.BodyText, 300)

    If the client has put any links (using RTE) into the first section of the body text it simply does not display in the feed. However if I remove the truncation and simply display the item body text everything displays as normal.

    Does anyone have a workaround?

    Many Thanks

    Chris

  • Gary Devenay 39 posts 245 karma points
    Aug 05, 2015 @ 14:35
    Gary Devenay
    0

    Hi Christopher,

    You could try something like the following:

    @Umbraco.Truncate(Umbraco.StripHtml(item.BodyText), 300)
    

    Thanks

    Gary

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Aug 05, 2015 @ 14:39
    Dennis Aaen
    0

    Hi Chris,

    Should your uset be able to add HTML into the RTE field if not then you can use the @Umbraco.StripHtml method first.

    Hope this helps and can be a solution for you.

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft