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?
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?
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)
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
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,
Was just about to create a topic with the same issue.
To me it appears to be a bug in umbraco 4.5.*
- Sune
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
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?
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
is working on a reply...