Copied to clipboard

Flag this post as spam?

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


  • CodeMaster2008 151 posts 184 karma points
    Jul 06, 2010 @ 04:58
    CodeMaster2008
    0

    Rendering Macro Container

    The new macro container is really cool but how can we render it from a xslt?

  • Simon Kibsgård 62 posts 73 karma points
    Jul 06, 2010 @ 15:05
    Simon Kibsgård
    0

    Hi CodeMaster2008

    You can fetch it with <xsl:value-of select="$currentPage/* [name() = 'relatedExtra' and not(@isDoc)]" disable-output-escaping="yes" /> (where 'relatedExtra'¨is the name of your macro container datatype property on the page).

    I can't get it to render well though. When I don't disable output escaping I get an escaped rendering of the the correct <umbraco:macro />. But, it's not inserted when I disable escaping. It seems to me, that these runat server now, and maybe can't be inserted with XSLT. Try Codebehind or with page field in the template. 

     

  • Domenique 10 posts 40 karma points
    Aug 02, 2010 @ 16:06
    Domenique
    2

    Hi CodeMaster2008 and Simon, 

    I had the same issues.. but :) Solved in xslt with: 

    <xsl:value-of select="umbraco.library:RenderMacroContent($currentPage/yourMacroContainerProperty, $currentPage/@id)" disable-output-escaping="yes"/>            

    This will render al the macro's included inside your MacroContainerProperty. 

    Using umb 4.5.1 for this example.

    Kind regards, 

    Domenique


     

     

  • Simon Kibsgård 62 posts 73 karma points
    Aug 02, 2010 @ 16:37
    Simon Kibsgård
    0

    Hi Domenique.

    Cool, thanks for sharing.

  • CodeMaster2008 151 posts 184 karma points
    Aug 02, 2010 @ 23:06
    CodeMaster2008
    0

    Thanks man, that really helps.

  • Domenique 10 posts 40 karma points
    Aug 03, 2010 @ 12:01
    Domenique
    1

    No problem :) Just beeing part of this great community..  and got some (+1) karma to haha..

Please Sign in or register to post replies

Write your reply to:

Draft