Copied to clipboard

Flag this post as spam?

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


  • Bas Wensveen 54 posts 75 karma points
    Jan 05, 2010 @ 20:09
    Bas Wensveen
    0

    RenderTemplate changes the currentPage

    All,

     

    I read a topic on this issue (see link below), but the workaround suggested is not working for me. I need to access the currentPage in other script then the one where RenderTemplete is used. Does someone have a solution for this bug/issue?

    forum.umbraco.org/...Template-and-currentPage.aspx

    I'm looking forward to your answer.

    Kind regards,

     

     

    Bas

  • Bas Wensveen 54 posts 75 karma points
    Jan 07, 2010 @ 20:51
    Bas Wensveen
    0

    I did post this topic already 4 day ago. DId not get any replies, is there no solution or tip to get me started to solve it?

    Any help appreciated!

     

    Regards,

     

     

     

  • Fengelz 106 posts 221 karma points
    Sep 28, 2010 @ 10:56
    Fengelz
    0

    Was just about to create a topic with the same issue.

    To me it appears to be a bug in umbraco 4.5.*

    - Sune

  • Fengelz 106 posts 221 karma points
    Sep 28, 2010 @ 11:06
    Fengelz
    0

    Ok just found a workaround that helped me in my case.

    <xsl:for-each select="Exslt.ExsltStrings:split($field,',')">
        <xsl:variable name="templateId" select="umbraco.library:GetXmlNodeById(.)/@template" />    
        <xsl:value-of disable-output-escaping="yes" select="umbraco.library:RenderTemplate(.,$templateId)"/>
     </xsl:for-each>

    If you extract the template id from the node you wish to render it works (for me anywho)

    hth

    - Sune

  • Fengelz 106 posts 221 karma points
    Sep 28, 2010 @ 14:43
    Fengelz
    0

    Sorry just now saw that you couldn't use the workaround I posted (which where also in the thread). Perhaps if you'd post an example of how you need to use it?

  • Antony Briggs 78 posts 103 karma points
    Jun 20, 2011 @ 15:41
    Antony Briggs
    0

    Phew, I got myself into a real panic there when I thought I couldn't use RenderTemplate!

    The bug still exists in v4.7 in the plain RenderTemplate(int PageId) method, but a workaround has been coded into the version that takes a TemplateID so Fengels workaround (above) still works fine.

    It saves the httpContext.Items before the Server.Execute() call then restores them afterwards - I'm not sure why the fix was never copied to the 'default' version? (Or indeed, why one does not simply call the other)

    Ant



Please Sign in or register to post replies

Write your reply to:

Draft