I am trying to get a list of images in a Folder of the media section however the folder is just returning XML with an empty <content /> node despite there being images in the folder.
I can confirm that the id is correct for the folder in the media section and there is 5 JPG images in there which are not being returned in the XML when I use:
In your GetMedia call, set deep to true. If that's not possible, do a new GetMedia call with the id of $StartNode and then set deep to true in that one:
It's coming via a mediaCurrent macro parameter so I'm guessing as per something Sebastiaan just said on twitter it may just be that it only returns the current node and not it's children?
Ok, so on top of Sebastiaans answer, if you have this setup as a macro and have a MediaCurrent property type setup, yes, this will return a media Item, but it won't be deep as Sebastiaan has mentioned, so you'll need to do a GetMedia with the deep set to true to get the child media items.
Media Folder Node Empty
I am trying to get a list of images in a Folder of the media section however the folder is just returning XML with an empty <content /> node despite there being images in the folder.
I can confirm that the id is correct for the folder in the media section and there is 5 JPG images in there which are not being returned in the XML when I use:
any ideas anyone?
Thanks, Simon
Hey Simon,
How are you setting the $StartNode variable?
Cheers
Matt
In your GetMedia call, set deep to true. If that's not possible, do a new GetMedia call with the id of $StartNode and then set deep to true in that one:
It's coming via a mediaCurrent macro parameter so I'm guessing as per something Sebastiaan just said on twitter it may just be that it only returns the current node and not it's children?
Damn you sebastiaan :P
Ok, so on top of Sebastiaans answer, if you have this setup as a macro and have a MediaCurrent property type setup, yes, this will return a media Item, but it won't be deep as Sebastiaan has mentioned, so you'll need to do a GetMedia with the deep set to true to get the child media items.
Matt
lol @ Matt, I do still like XSLT ;-)
Thanks guys - "there can be only one"...solution I'm afraid :)
Beh! I think you'll find I was the one that described the actual issue you were having, Sebastiaan just pasted some code with no reasoning :P
What are we, back in highschool? ;-)
is working on a reply...