Copied to clipboard

Flag this post as spam?

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


  • gilad 185 posts 425 karma points
    Mar 15, 2011 @ 12:43
    gilad
    0

    get short text from richTextEditor

    hello all.

    i have a Articles page with sub pages - private article.

    Client does not want to insert body text and short description(for list page - articles) for each private aticles

    so i have two problem -

    1 - how to get just text from rich text editor - ( with out html tags )

    2 - then i need to take lets say only the first 200 characters or all if length is less.

    thanks ans regards.


  • Kim Andersen 1447 posts 2196 karma points MVP
    Mar 15, 2011 @ 12:46
    Kim Andersen
    1

    Hi gilad

    Try this out:

    <xsl:value-of select="umbraco.library:TruncateString(umbraco.library:StripHtml($currentPage/aliasOfEditor),'200','')" />

    Does that work?

    /Kim A

  • gilad 185 posts 425 karma points
    Mar 15, 2011 @ 13:09
    gilad
    0

    wow! that was fast!

    thank you very match kim.

    there is any way to delete all last characters till last " ".   ??

    i wnat to check that is not end in the Middle of word.

  • Kim Andersen 1447 posts 2196 karma points MVP
    Mar 15, 2011 @ 13:24
    Kim Andersen
    0

    You are welcome.

    The other part about not splitting u a word, can't be done using the above extensions. I can't remember if one of the extensions in the uComponents-package can do this. BUt maybe you could give it a try.

    Another approach could be to inser three dots ( ... ) in the last parameter of the TruncateString-extension like this:

    <xsl:value-of select="umbraco.library:TruncateString(umbraco.library:StripHtml($currentPage/aliasOfEditor),'200','...')" />

    This would result in three dots inserted after the last character, showing the users that this text is continued somewhere. Just a suggestion :)

    /Kim A

  • gilad 185 posts 425 karma points
    Mar 15, 2011 @ 13:52
    gilad
    0

    Meanwhile I will take your advice :)

    thanks again.

Please Sign in or register to post replies

Write your reply to:

Draft