Ok this is bugging the crap out of me... I'm trying to get the latest blog posts from the root Blog which I choose with a content picker - It all saves fine
What the heck!?? Now explain how this language actually makes sense :S
So I decided to hard code the nodeId in everything, just to test it and use the same select method I used above in the copy-of (As I know that works)... Yep you guessed it, it works using copy-of / value-of in the XSL visualiser... But If change it to
GetXmlNodeById expects an integer. When saving the xslt, umbraco checks against the root-node. This probably doesn't make your $latestposts being filled correctly, thus not being an integer. This results in the error you recieved.
In your original if-statement, you check against the full path. This doesn't make much sense since the error you got is caused by GetXmlNodeByID and not by the for-each. So, what you actually did was causing the same error twice ;-)
Maybe this has nothing to do with it, but just to make sure, try to print the $latestposts in a <textarea> and see if the right value is in the variable.
This is a wild shot, so like dillorscroft says, could you post your full XSLT-file? I think that this could help. Otherwise, try using the umbdebugshowtrace=true parameter in the URL and see if you are getting any errors.
Typical Example - How Annoying Is XSLT
Ok this is bugging the crap out of me... I'm trying to get the latest blog posts from the root Blog which I choose with a content picker - It all saves fine
Now if I do this (1092 is the node I have selected in the macro)
I get all the XML perfectly, however in the page all I'm getting is
What the heck!?? Now explain how this language actually makes sense :S
So I decided to hard code the nodeId in everything, just to test it and use the same select method I used above in the copy-of (As I know that works)... Yep you guessed it, it works using copy-of / value-of in the XSL visualiser... But If change it to
I get this error!?
asdasd
ok weird it posted twice - See this post
http://our.umbraco.org/forum/developers/xslt/7578-Typical-Example---How-Annoying-Is-XSLT
Try this:
HTH,
Peter
Explanation:
GetXmlNodeById expects an integer. When saving the xslt, umbraco checks against the root-node. This probably doesn't make your $latestposts being filled correctly, thus not being an integer. This results in the error you recieved.
In your original if-statement, you check against the full path. This doesn't make much sense since the error you got is caused by GetXmlNodeByID and not by the for-each. So, what you actually did was causing the same error twice ;-)
Hope this clarifies a bit,
Peter
Hey Peter
Thanks for posting, I'm afraid this isn't the cure - I have tried this and get the same error?? Here is the full XSLT
Still same error? As I say if I do a value-of/copy-of I get the results fine?
Are you able to post the full XSLT?
Hi Lee,
Have you tried a very simple showpost, to determine if the problem is with the node selection or somewhere inside the showpost template?
E.g., rename your current "showpost" template to "dontshowpost", and use something like this instead:
/Chriztian
Hi Lee
Just a quick idea. Are you sure that you are getting the right node-id from the macro parameter?
I usually use:
Instead of this:
without the / in the front.
Maybe this has nothing to do with it, but just to make sure, try to print the $latestposts in a <textarea> and see if the right value is in the variable.
This is a wild shot, so like dillorscroft says, could you post your full XSLT-file? I think that this could help. Otherwise, try using the umbdebugshowtrace=true parameter in the URL and see if you are getting any errors.
/Kim A
Lee,
There are a few NiceUrl(@id) in your template and a tagsLib:getTagsFromNode(@id). I think they should be replaced with NiceUrl($post/@id).
Could you try that and report back?
Peter
PS: if you try Chriztian's example, if that works, you know the fault is in the template. And I might be right then.
Ok thanks to Peter it was in the template :)
It was in the for each section of the tags, here
I changed it to
And we are in business :)
is working on a reply...