Ok found a solution.... loaded the root media folder (from an ID) then looped through each folder name until I find a match. Not perfect, but works....
If the requested folder can be inside another, put a doubleslash between $allTheMedia and Folder (e.g.: $allTheMedia//Folder[...]) - but it will affect performance in large libraries...
Finding the media folder ID from the folders name
Hi
Trying to make a very simple method of showing a gallery uploaded with 'Desktop Media Uploader'
The bellow code works if I pass the media folder ID via querystring....
http://www.myurl.com/gallery.aspx?folderid=1443
<xsl:variable name="url" select="umbraco.library:RequestQueryString('folderid')" />
<xsl:for-each select="umbraco.library:GetMedia($url, true())/Image">
....
But the user has to login to Umbraco to find this. I want them to be able to upload a folder and then call it from the url with just the folders name.
http://www.myurl.com/gallery.aspx?foldername=FolderIJustUploaded
Any ideas??
Thanks
Mark
Mmm.. th second link should be http://www.myurl.com/gallery.aspx?foldername=folderx
Not sure why the forum cut that..
Ok found a solution.... loaded the root media folder (from an ID) then looped through each folder name until I find a match. Not perfect, but works....
Hi Mark,
You can XPath as soon as you'e got all the XML, e.g. (replace ROOT_ID with the id of your root media folder):
/Chriztian
is working on a reply...