It should output xml to the macro parameter, so <xsl:copy-of select="/macro/MyNode" /> _should_ give you some xml output, unless the ID you are entering into the parameter does not have any content in the DB.
But in this specific case, if my macro parameter is a mediaCurrent type, and I choose a folder containing images, how can I see the XML info for these?
Ah, you will not get the sub items when you use the mediaCurrent. You only get the specific item that you have selected, so in your case you only get the folder info, and not the child images.
(By the way, are you using 4.0.x or 4.1? There might be differences between them)
Ok, thanks! I'm using 4.0,2. Is there a way to get the sub items? I am asking because I would like to have a randomly chosen image from a chosen folder. I cannot find how the folder is "connected" to it's sub items. Thanks.
If you change your macro parameter to be a number instead, then you can use the umbraco.library.GetMedia(int nodeid, bool deep) to get sub items as well. just set the "deep" parameter to 1.
XML representation of media
Hi guys,
If I have a macro parameter MyNode of type mediaCurrent, where I choose a media folder containing image files, should not
<xsl:copy-of select="/macro/MyNode" /> give me something like
<MyNode>
<node id="1234" nodeTypeAlias="Folder" bla bla...>
<image>
<data alias="prop1">xxx</data>
<data alias="prop2">xxx</data>
</image>
<image>
<data alias="prop1">xxx</data>
<data alias="prop2">xxx</data>
</image>
</node>
</MyNode>
Or should umbraco.library.GetMedia(int nodeid, bool deep) give me this xml representation? I have no success neither way.
Thanks,
Synsat
It should output xml to the macro parameter, so <xsl:copy-of select="/macro/MyNode" /> _should_ give you some xml output, unless the ID you are entering into the parameter does not have any content in the DB.
But in this specific case, if my macro parameter is a mediaCurrent type, and I choose a folder containing images, how can I see the XML info for these?
Ah, you will not get the sub items when you use the mediaCurrent. You only get the specific item that you have selected, so in your case you only get the folder info, and not the child images.
(By the way, are you using 4.0.x or 4.1? There might be differences between them)
Ok, thanks! I'm using 4.0,2. Is there a way to get the sub items? I am asking because I would like to have a randomly chosen image from a chosen folder. I cannot find how the folder is "connected" to it's sub items. Thanks.
If you change your macro parameter to be a number instead, then you can use the umbraco.library.GetMedia(int nodeid, bool deep) to get sub items as well. just set the "deep" parameter to 1.
I have tried that a few times earlier without seeing the xml structure... Just realized that <xmp></xmp> is necessary :(
is working on a reply...