Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi All
I created a folder in media section. after that i upload 3 files into this folder. And i try to get list of 3 file in this folder by the folder Node ID but it did not work.
My xslt look l
<xsl:param name="currentPage"/><xsl:param name="ParentNodeID" select="/macro/ParentNodeID"/> <xsl:template match="/"><!-- start writing XSLT --><xsl:if test="$ParentNodeID!=''"> <table class='exchOn' id="MoneySaverate" border="0" cellspacing="1"> <tbody> <xsl:for-each select="umbraco.library:GetMedia($ParentNodeID, 'true')/*[@isDoc]"> <a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a> </xsl:for-each> </tbody> </table></xsl:if>
The $ParentNodeId is the argument of the Macro. it is the node Id of the folder that contains 3 files
I use umbraco 4.6.0 alpha
thanh for your patience.
do you get nothing at all? or just three empty links?
ie when you view source - or if you add a character (I always add a Z just so I remember I need to take it out) does that repeat 3 times?
I suspect that the problem is that {umbraco.library:NiceUrl(@id)}and @nodeName do not return anything for a media item
it's a different library call for a media item id
i'll check this out if you the above is the case and let you know which is the correct call
however if it's returning nothing at all then it would be a different problem
Hi -
I haven't tested on 4.6, but a few things on 4.5
- Remove the [@isDoc] from your for-each xpath - Media items don't use this
- Media Items also don't use NiceUrl as stated above - use href="{umbracoFile}" instead to link directly to the media item
<xsl:for-each select="umbraco.library:GetMedia($ParentNodeID, true())/*"> <a href="{umbracoFile}"><xsl:value-of select="@nodeName"/></a> </xsl:for-each>
Thank you 2 of you
Dear Tom: it works smoothly. thank you so much, you save my time.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Get list of media in a folder by NodeID
Hi All
I created a folder in media section. after that i upload 3 files into this folder. And i try to get list of 3 file in this folder by the folder Node ID but it did not work.
My xslt look l
The $ParentNodeId is the argument of the Macro. it is the node Id of the folder that contains 3 files
I use umbraco 4.6.0 alpha
thanh for your patience.
do you get nothing at all? or just three empty links?
ie when you view source - or if you add a character (I always add a Z just so I remember I need to take it out) does that repeat 3 times?
I suspect that the problem is that {umbraco.library:NiceUrl(@id)}and @nodeName do not return anything for a media item
it's a different library call for a media item id
i'll check this out if you the above is the case and let you know which is the correct call
however if it's returning nothing at all then it would be a different problem
Hi -
I haven't tested on 4.6, but a few things on 4.5
- Remove the [@isDoc] from your for-each xpath - Media items don't use this
- Media Items also don't use NiceUrl as stated above - use href="{umbracoFile}" instead to link directly to the media item
Thank you 2 of you
Dear Tom: it works smoothly. thank you so much, you save my time.
is working on a reply...