Copied to clipboard

Flag this post as spam?

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


  • Fuji Kusaka 2203 posts 4220 karma points
    Apr 13, 2012 @ 17:03
    Fuji Kusaka
    0

    disable-output-escaping="yes"

    Can someone help on this? i have my "disable-output-escaping="yes" set to "yes" and yet when the content is displayed i get <p><strong>Text</strong> as output and when set to 'No" the content is scramble!!

    I dont have this issue in my other xslt however. Any suggestion on this??

    //fuji

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Apr 13, 2012 @ 18:00
    Lee Kelleher
    0

    Hi Fuji,

    What data-type is used for the property? Is it a rich-text editor? (TinyMCE)

    The 'disable-output-escaping' basically keeps the less-than < and greater-than > characters as they are, instead of converting them into their entities (&lt; and &gt;).

    Not sure how this is causing you a problem, if you are still having an issue with it, could you provide a code snippet along with an explanation of what you would like to achieve.

    Thanks, Lee.

  • Fuji Kusaka 2203 posts 4220 karma points
    Apr 13, 2012 @ 19:43
    Fuji Kusaka
    0

    Hi Lee,

    Yes am using the Rich-text editor under v 4.7.1.

    Well lets say when typying some text in the wysiwyg, its always displaying the <p> Tag (in the case when disable output is set to No.)

    On the other hand if i set it to "Yes" my content output is all squeeze!!!

    Here is my xslt

    <xsl:value-of select="umbraco.library:TruncateString(eDes, 150, '...')" disable-output-escaping="yes"/>

     

    //fuji

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Apr 14, 2012 @ 13:01
    Lee Kelleher
    0

    Hi Fuji,

    The TruncateString will not remove any of the HTML, so if you would like to get the plain-text, then try this:

    <xsl:value-of select="umbraco.library:TruncateString(umbraco.library:StripHTML(eDes), 150, '...')" />

    If you would like the HTML to be intact, then that is much much more difficult.  However, the guys at Cogworks have written something to do this - no package release, just a code snippet, read more on their blog post: http://thecogworks.co.uk/blog/2011/1/21/n-word-preview-for-blog4umbraco

    Good luck!

    Cheers, Lee.

  • Fuji Kusaka 2203 posts 4220 karma points
    Apr 14, 2012 @ 20:06
    Fuji Kusaka
    0

    Hi Lee,

    Unfortunately this didnt work for me, its returning an error when saving my xslt.

    System.Xml.Xsl.XslTransformException: Extension object 'urn:umbraco.library' does not contain a matching 'StripHTML' method that has 1 parameter(s)

    Its quiet annoying, lets say the admin just paste some text in the wysiwyg with a <p> tag or any other tag like <strong>, the output is not really nice.

     

    //fuji

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Apr 14, 2012 @ 20:13
    Lee Kelleher
    0

    Sorry, I wrote the XSLT off the top of my head... I got the casing wrong for the function name.

    It should be "StripHtml", not "StripHTML". Doh! ;-)

    <xsl:value-of select="umbraco.library:TruncateString(umbraco.library:StripHtml(eDes), 150, '...')" />

    Cheers, Lee.

Please Sign in or register to post replies

Write your reply to:

Draft