I'm trying to integrate the JW Image Rotator into my Umbraco website and having a bit of trouble.
I have some XSLT which generates an RSS playlist that works fine when called directly.
When JW Image Rotator calls the RSS feed it adds "?123" where 123 is a random number to the end of the URL and this causes an XSLT Error:
<!-- Error generating macroContent: 'System.NullReferenceException: Object reference not set to an instance of an object. at umbraco.library.RenderTemplate(Int32 PageId, Int32 TemplateId)' -->
It looks like RenderTemplate doesn't like this random number for some reason.
A bit more info:
My content structure:
RSS Channel
-- RSS Item
-- RSS Item
To get the RSS feed I do a GET to the RSS channel content node which has a template with a macro that uses RenderTemplate to render the templates of each of the child node RSS Items.
Anyone else come across this or got any ideas how to fix it?
Now navigate to the RSS Channel item in the content tree and append ?123 to the URL. The RSS Item nodes will now no longer render correctly and will give the error above.
(I've also tried the single argument version of RenderTemplate and had the same problem).
Any ideas? I've read that this random number has given other people trouble with PHP based CMSs.
So RenderTemplate doesn't like having unpaired things in the query string.
I've not used URL rewriting either - is there anyone out there who could give me some simple instructions how I could rewrite the URL to remove this random number?
quite a horibal hack but perhaps you could you create an alt template that does the render template bit in your macro and get the default template to use GetXmlDocumentByUrl to call the same page with the alt template? Or write some also hacky c# to clear the qsring
I used RenderTemplate to render the HTML for a confirmation email at the url "www.blahblah.com?unsubscribe" <- RenderTemplate casts an exception when used on a url like this.
Workaround was to redirect to another url and send the email from there.
Query String Problems
Hi,
I'm trying to integrate the JW Image Rotator into my Umbraco website and having a bit of trouble.
I have some XSLT which generates an RSS playlist that works fine when called directly.
When JW Image Rotator calls the RSS feed it adds "?123" where 123 is a random number to the end of the URL and this causes an XSLT Error:
It looks like RenderTemplate doesn't like this random number for some reason.
A bit more info:
My content structure:
RSS Channel
-- RSS Item
-- RSS Item
To get the RSS feed I do a GET to the RSS channel content node which has a template with a macro that uses RenderTemplate to render the templates of each of the child node RSS Items.
Anyone else come across this or got any ideas how to fix it?
Hey,
What is the code for you xslt macro and template. Because I just tried appending this querystring to one of my umbraco sites and it works fine.
Dave
Hi,
Thanks for the reply. I think the problem is with the RenderTemplate function - it doesn't affect every page.
To replicate this create the structure as shown in my first post in the content section.
Each RSS Item should have a template. The template for RSS Channel should contain a macro calling XSLT which contains the following:
Now navigate to the RSS Channel item in the content tree and append ?123 to the URL. The RSS Item nodes will now no longer render correctly and will give the error above.
(I've also tried the single argument version of RenderTemplate and had the same problem).
Any ideas? I've read that this random number has given other people trouble with PHP based CMSs.
I think the problem lies in the rendertemplate function. Reflector gives me this code for this function :
As you can see the function makes a call to your "Rss Item" with the given template. It also appends the querystring ("123")
Maybe you can remove this querystring with UrlRewriting but I'm not an expert.
Dave
Hmmm...
So RenderTemplate doesn't like having unpaired things in the query string.
I've not used URL rewriting either - is there anyone out there who could give me some simple instructions how I could rewrite the URL to remove this random number?
Thanks
Ed if this is a bug you should submit it to codeplex.
On codeplex:
http://umbraco.codeplex.com/WorkItem/View.aspx?WorkItemId=24967
Any further suggestions still welcome though.
quite a horibal hack but perhaps you could you create an alt template that does the render template bit in your macro and get the default template to use GetXmlDocumentByUrl to call the same page with the alt template? Or write some also hacky c# to clear the qsring
I can confirm this error.
I used RenderTemplate to render the HTML for a confirmation email at the url "www.blahblah.com?unsubscribe" <- RenderTemplate casts an exception when used on a url like this.
Workaround was to redirect to another url and send the email from there.
/Dennis
Thanks.
Please vote on codeplex if this issue affects you!
http://umbraco.codeplex.com/WorkItem/View.aspx?WorkItemId=24967
is working on a reply...