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 added a new property (title) to the Image media type but can't seem to get it work in the xslt.
<xsl:param name="imageFolder" select="/macro/imageFolder/Folder/@id"/> <xsl:if test="$imageFolder != 0"> <p style="text-align: center;"> <xsl:for-each select="umbraco.library:GetMedia($imageFolder, 'true')/descendant-or-self::*[@nodeTypeAlias='Image']/umbracoFile"> <img style="width: 50px; margin-left: 5px; margin-right: 5px;"> <xsl:attribute name="src"><xsl:value-of select="." /></xsl:attribute> <xsl:attribute name="alt"><xsl:value-of select="../@nodeName" /></xsl:attribute> <xsl:attribute name="title"><xsl:value-of select="./title" /></xsl:attribute> </img> </xsl:for-each> </p> </xsl:if>
Always comes out blank, Any ideas, know i must have missed something simple somewhere.
Solved, I was enuming the umbracoFile node.
Should be
<xsl:for-each select="umbraco.library:GetMedia($imageFolder, 'true')/descendant-or-self::*[@nodeTypeAlias='Image']">
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
Custom property from image media type
I added a new property (title) to the Image media type but can't seem to get it work in the xslt.
<xsl:param name="imageFolder" select="/macro/imageFolder/Folder/@id"/>
<xsl:if test="$imageFolder != 0">
<p style="text-align: center;">
<xsl:for-each select="umbraco.library:GetMedia($imageFolder, 'true')/descendant-or-self::*[@nodeTypeAlias='Image']/umbracoFile">
<img style="width: 50px; margin-left: 5px; margin-right: 5px;">
<xsl:attribute name="src"><xsl:value-of select="." /></xsl:attribute>
<xsl:attribute name="alt"><xsl:value-of select="../@nodeName" /></xsl:attribute>
<xsl:attribute name="title"><xsl:value-of select="./title" /></xsl:attribute>
</img>
</xsl:for-each>
</p>
</xsl:if>
Always comes out blank, Any ideas, know i must have missed something simple somewhere.
Solved, I was enuming the umbracoFile node.
Should be
<xsl:for-each select="umbraco.library:GetMedia($imageFolder, 'true')/descendant-or-self::*[@nodeTypeAlias='Image']">
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.