I'v created an xslt file from the the standard template "List Sub Pages From Current Pages" and it works perfect all in all - however I'm facing a delicate problem. The nodenames from the subpages loops perfectly file but the images don't. On the subpages I've contenttext and images(choosen bu the imagepicker property).
As mentioned the nodenames loops fine but all images are the same - actually it's the latest updated image which repeats itself instead of looping... :-/
try the updated code sample i pasted above, inside the foreach loop, you shouldn't be using $currentpage again, as this doesn't reflect the current item in the foreach loop, in instead the same current page as always...
I would'nt worry about that because the image picker property has a Mandatory=true attribute so I cannot publish a new note without an image... - but thanks for the code snippet - worked perfectly... tmx m8
Great to hear that it worked out Robin. Even though the property is mandatory, it's a nice way of debugging theese kinds of things. And maybe some day something goes wrong in the publishing or something like that - in those cases it's nice to have made some "bulletproof" code that won't break :)
Can't loop images from subpages
I'v created an xslt file from the the standard template "List Sub Pages From Current Pages" and it works perfect all in all - however I'm facing a delicate problem. The nodenames from the subpages loops perfectly file but the images don't. On the subpages I've contenttext and images(choosen bu the imagepicker property).
what output do you have?
Why are you using
$currentPage/*
inside the foreach loop? you want to use the current item i believe?
try this:
replace ImageProperty by the alias of the image
As mentioned the nodenames loops fine but all images are the same - actually it's the latest updated image which repeats itself instead of looping... :-/
try the updated code sample i pasted above, inside the foreach loop, you shouldn't be using $currentpage again, as this doesn't reflect the current item in the foreach loop, in instead the same current page as always...
I hate to say it but I dont get any output from this line - only this wellknown message: Error reading XSLT.... :-(
By ImageProperty I suppose you mean newsImage whics is the name of my ImagePicker property...
I use Umbraco 4_5_2 for ASP.NET 3.5 by the way...
Hi Robin
Try this code out:
The code might fail if some of the nodes has an empty newsImage property. Then the GetMedia extension will fail for sure.
/Kim A
I would'nt worry about that because the image picker property has a Mandatory=true attribute so I cannot publish a new note without an image... - but thanks for the code snippet - worked perfectly... tmx m8
Great to hear that it worked out Robin. Even though the property is mandatory, it's a nice way of debugging theese kinds of things. And maybe some day something goes wrong in the publishing or something like that - in those cases it's nice to have made some "bulletproof" code that won't break :)
But glad you got it working :)
/Kim A
is working on a reply...