Copied to clipboard

Flag this post as spam?

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


  • Vincent DeCapite 64 posts 83 karma points
    Feb 11, 2011 @ 13:56
    Vincent DeCapite
    0

    XSLT displaying Everything For Field

    Hi There,

    I am trying to pull out information from one field into an umbraco page so it shows up. Here is the code that I am using:

    <xsl:if test="$product/data [@alias = 'textDisclaimers'] != ''">
                 <xsl:value-of select="$product/data [@alias = 'textDisclaimers']" />
                </xsl:if>

    The problem is that it is showing everything so on the page, I am getting an output like this:<p><span class="smaller">For use with the PillCam SB video capsule.<br /> </span><span class="smaller">(This product has been manufactured not to include latex.)</span></p>...

    Any specific reason why this is happening? Or am I missing some piece of code?

    Thanks for your help.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 11, 2011 @ 14:03
    Jan Skovgaard
    1

    Hi Vincent

    You need to add disable-output-escaping="yes" to your <xsl:value of- /> Like this

    <xsl:value-of select="$product/data [@alias = 'textDisclaimers']" disable-output-escaping="yes" />

    /Jan

  • Vincent DeCapite 64 posts 83 karma points
    Feb 11, 2011 @ 14:08
    Vincent DeCapite
    0

    Thanks for the quick response, that worked but now it is not taking the styles... I can't use any styles to format the text

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Feb 11, 2011 @ 14:09
    Jan Skovgaard
    0

    Place the html around your <xsl:value-of select="" /> perhaps? :-)

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft