Copied to clipboard

Flag this post as spam?

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


  • Ivan 165 posts 542 karma points
    Mar 26, 2013 @ 08:20
    Ivan
    0

    RenderMacroContent. How do I output RTE content in macro?

    Hi everybody.

    There're 2 xslt templates:

    1) RenderAll.xslt - outputs all content on the page depending on what macros have been selected.

    2) RenderNews.xlst - outputs news list.

    The structure is as follows:

     

    RenderAll.xslt
    <xsl:value-of select="umbraco.library:RenderMacroContent('selector', $currentPage/@id)" /> 

     

    This piece of code gives empty string. Why?

    RenderNews.xslt
    <xsl:value-of select="umbraco.library:Item($currentPage/@id, 'textRTE')" />

     

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Mar 26, 2013 @ 09:03
    Fuji Kusaka
    0

    just call your property alias

    <xsl:value-of select="textRTE" disable-output-escaping="yes"/>
  • Ivan 165 posts 542 karma points
    Mar 26, 2013 @ 09:50
    Ivan
    0

    In that case It's not possible to output macros via RTE.

  • Fuji Kusaka 2203 posts 4220 karma points
    Mar 26, 2013 @ 11:36
    Fuji Kusaka
    0

    Yes you can output your macros in your RTE. For this to work you need to go under Developer Section > Macros  > Choose your macros > Render content in editor

  • Ivan 165 posts 542 karma points
    Mar 26, 2013 @ 11:42
    Ivan
    0

    Nope it doesn't work like that.

    umbraco.library:Item is used for the reason - to render macro that placed within RTE. Otherwise I would just just use pure <xsl:value-of select="rte" /> as you suggested.

    The problem is that umbraco.library:Item doesn' work properly when called via umbraco.library:RenderMacroContent.

  • Fuji Kusaka 2203 posts 4220 karma points
    Mar 26, 2013 @ 12:00
    Fuji Kusaka
    0

    Holy Crap.....its not Render in Content in Editor but "Use in editor"

  • Ivan 165 posts 542 karma points
    Mar 26, 2013 @ 13:20
    Ivan
    0

    Same thing.

    <xsl:value-of select="rte" /> - works

    <xsl:value-of select="umbraco.library:Item(@id, 'rte') /> - doesn't work

    Any thought why the second variant doesn't work?

  • Fuji Kusaka 2203 posts 4220 karma points
    Mar 26, 2013 @ 13:31
    Fuji Kusaka
    101

    What version of umbraco are you using btw ?

    This topic might help you

  • Ivan 165 posts 542 karma points
    Mar 26, 2013 @ 14:21
    Ivan
    0

    Thanks, I'll check this one.

    Umbraco version is 4.11.1

  • Ivan 165 posts 542 karma points
    Apr 03, 2013 @ 19:57
    Ivan
    1

    Thanks, Fuji.

    The following expression (from the topic you mentioned) did work for me and solved the problem:

    RenderNews.xslt
    <xsl:value-of select="umbraco.library:RenderMacroContent($currentPage/textRTE, $currentPage/@id)"/>
  • Fuji Kusaka 2203 posts 4220 karma points
    Apr 03, 2013 @ 20:01
    Fuji Kusaka
    0

    Hi Ivan,

    Great you got it working!!!! :)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies