I am trying to get a listing of child node folders from a specific media id, which is chosen in with the media picker. The folder structure is as follows:
Media - Departments - Department A - Photo Group 1 - photo 1, photo 2, etc... - Photo Group 2 - photo 1, photo 2, etc...
In the media picker I have Department A selected and with the code below, it will only display images that are in that folder directly. I cant seem to figure out how to retrieve the photos in the children folders/nodes. I have tried using $currentPage/DepartmentGallery/*[@isDoc], but that does not seem to return anything
Listing media child nodes/sub folders
I am trying to get a listing of child node folders from a specific media id, which is chosen in with the media picker. The folder structure is as follows:
Media
- Departments
- Department A
- Photo Group 1
- photo 1, photo 2, etc...
- Photo Group 2
- photo 1, photo 2, etc...
In the media picker I have Department A selected and with the code below, it will only display images that are in that folder directly. I cant seem to figure out how to retrieve the photos in the children folders/nodes. I have tried using $currentPage/DepartmentGallery/*[@isDoc], but that does not seem to return anything
<xsl:variable name="imageRoot" select="$currentPage/DepartmentGallery"/>
<xsl:if test="string-length($imageRoot) > 0">
<xsl:for-each select="umbraco.library:GetMedia($imageRoot, '0')/Image">
<img src="{umbracoFile}" width="100"/>
</xsl:for-each>
</xsl:if>
Thanks for the help!
Hi. Try this:
Wow, so simple of a solution. Thanks so much!
is working on a reply...