Copied to clipboard

Flag this post as spam?

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


  • Martin Sørensen 4 posts 24 karma points
    Jan 22, 2014 @ 09:47
    Martin Sørensen
    0

    Macro format Richtext Editor content with html as text

    I have created a document type called Box with a Textstring for title and a Richtext editor for the content.

    I loop through all boxes and place them in a div, where they are meant to work as a 'box slider'. The sliding effect is working fine, but when I insert the Richtext editor in the macro it shows the content as text with html-tags. When I hardcode some html in the div, it is shown correctly - only fails with content from Richtext editor.

    Why does it not render the html ?

    My XSLT:

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <div id="boxLeftSlider" class="boxSlider">

    <xsl:for-each select="$currentPage/ancestor-or-self::*//Box[boxPlace = '6']">

    <div>

    <h2><xsl:value-of select="boxTitle"/></h2>

    <xsl:value-of select="boxText" />  /* My richtext editor

    /* Hardcoded in each box and it works */

    <strong>Test strong</strong>

    <img src="/media/903/box_bg_50x50.jpg" width="50" height="50" alt="box_bg"/>

    /* Hardcoding end */

    </div>

    </xsl:for-each>

    </div>

    </xsl:template>

    </xsl:stylesheet>

    You can see it here: http://spec.dk.nt21.unoeuro-server.com/

    I am using Umbraco v. 4.9

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Jan 22, 2014 @ 09:51
    Chriztian Steinmeier
    0

    Hi Martin,

    To render the RTE contents as HTML you need to add the disable-output-escaping attribute, like this:

    <xsl:value-of select="boxText" disable-output-escaping="yes" />
    

    /Chriztian

  • Martin Sørensen 4 posts 24 karma points
    Jan 22, 2014 @ 10:01
    Martin Sørensen
    0

    Wauw that was easy.... Thanks a lot !

     

    /Martin

Please Sign in or register to post replies

Write your reply to:

Draft