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
I want to use a variable name instead of the "1043". Is that possible?
<xsl:value-of select="count(umbraco.library:GetMedia(1043,1)/node)"/>
Hi Bas,
Sure that's possible, use
<xsl:variable name="mediaId" select="/macro/mediaId" /> <xsl:value-of select="count(umbraco.library:GetMedia($mediaId,1)/node)"/>
in this case, mediaId variable is fetched from the macro properties settings tab.
(May run into xslt error when saving, but that can be resolved by adding an if statement that checks whether $mediaId != '')
Hope this helps.
Regards,
/Dirk
Hi Dirk,
Super! The extra IF fixed the problem.
<xsl:if test="$ImageFolder != ''"><xsl:value-of select="count(umbraco.library:GetMedia($ImageFolder,1)/node)"/></xsl:if>
Bas
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Count Items From Media
I want to use a variable name instead of the "1043". Is that possible?
<xsl:value-of select="count(umbraco.library:GetMedia(1043,1)/node)"/>
Hi Bas,
Sure that's possible, use
in this case, mediaId variable is fetched from the macro properties settings tab.
(May run into xslt error when saving, but that can be resolved by adding an if statement that checks whether $mediaId != '')
Hope this helps.
Regards,
/Dirk
Hi Dirk,
Super! The extra IF fixed the problem.
<xsl:if test="$ImageFolder != ''">
<xsl:value-of select="count(umbraco.library:GetMedia($ImageFolder,1)/node)"/>
</xsl:if>
Regards,
Bas
is working on a reply...