Copied to clipboard

Flag this post as spam?

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


  • Sebastian Dammark 583 posts 1407 karma points
    Feb 17, 2011 @ 00:47
    Sebastian Dammark
    0

    uComments through RenderMacroContent = fail

    Hi Folks

    I've downloaded the package uComments and it works fine when I drop the macro 'UCommentListComments' in my template.

    But when I need to render it through RenderMacroContent in my XSLT file it fails like this:
    <!-- Error generating macroContent: 'System.NullReferenceException: Object reference not set to an instance of an object. at umbraco.page..ctor(XmlNode xmlNode) at umbraco.library.RenderMacroContent(String Text, Int32 PageId)' -->

    This is how I render it:

    <xsl:value-of select="umb:RenderMacroContent('&lt;?UMBRACO_MACRO macroAlias=&quot;UCommentListComments&quot;&gt;&lt;/?UMBRACO_MACRO&gt;', @id)" />
  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Feb 18, 2011 @ 20:05
    Chriztian Steinmeier
    0

    Hi Sebastian,

    That @id you're sending to the function should be the id of the page you want to act as currentPage when the macro gets rendered, so make sure you're calling the function at a point where $currentPage is the context node. Safest solution would be to explicitly take it from $currentPage, e.g.: 

    <xsl:value-of select="umb:RenderMacroContent('yada-yada', $currentPage/@id)" />

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft