Hi guys, I begin using new schema and I try to convert an xslt from old to new but it doesn't work. The code should look in a folder "cardFolder" and then display all images within.
I tried with : 'true', true(), 1, 'false', false(), 0 and it changes nothing. $cardFolder gives the good node number but the for-each seems not to work.
At least you should pass in true() as 2nd parameter to GetMedia(), otherwise, you'd only get the current media item( which is probably a folder in your case). I always forget what gets returned but a simple xsl:copy-of should get you some details on the xml structure.
The correct one to use would be true() or 1 - 'false' only works because a non-empy string translates to true when passed on to C#. But that's not the problem - the problem is that your for-each, somehow doesn't select any Image elements - try using a double-slash before Image (e.g.: //Image) - there was a bug in an early version which required you to do that.
- Are you using Umbraco 4.7?
- Maybe your media has not been converted to the new format?
Nevertheless - use the good old copy-of to examine what you're getting back:
Ok, I tried the copy-of just after the if test and it gives me nothing. I mean blank, no data. I pass the 2nd parameter to true(), I'm using 4.7. I tried to place directly 3203 instead of $cardFolder.
3203, the current media, is a folder and in it there is images.
Chriztian, I also tried the double //... And what do you mean by "convert to new media?"
getMedia from old to new schema
Hi guys, I begin using new schema and I try to convert an xslt from old to new but it doesn't work. The code should look in a folder "cardFolder" and then display all images within.
The working old code :
The new one that doesn't work :
I tried with : 'true', true(), 1, 'false', false(), 0 and it changes nothing. $cardFolder gives the good node number but the for-each seems not to work.
Thank you for your help
Hi,
At least you should pass in true() as 2nd parameter to GetMedia(), otherwise, you'd only get the current media item( which is probably a folder in your case). I always forget what gets returned but a simple xsl:copy-of should get you some details on the xml structure.
Cheers,
/Dirk
Hi Profiterole,
The correct one to use would be true() or 1 - 'false' only works because a non-empy string translates to true when passed on to C#. But that's not the problem - the problem is that your for-each, somehow doesn't select any Image elements - try using a double-slash before Image (e.g.: //Image) - there was a bug in an early version which required you to do that.
- Are you using Umbraco 4.7?
- Maybe your media has not been converted to the new format?
Nevertheless - use the good old copy-of to examine what you're getting back:
/Chriztian
*slam*
Beaten by Dirk... :-)
Hi guys, thank you for your reply!
Ok, I tried the copy-of just after the if test and it gives me nothing. I mean blank, no data. I pass the 2nd parameter to true(), I'm using 4.7. I tried to place directly 3203 instead of $cardFolder.
3203, the current media, is a folder and in it there is images.
Chriztian, I also tried the double //... And what do you mean by "convert to new media?"
Another idea?
Hey,
Try to republish your media.
You can use this URL /umbraco/dialogs/republish.aspx?xml=true
rich
Rich, thank a lot!! Another new tool you made me discover!
Thank you all, now it works!
is working on a reply...