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...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
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...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.