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 would like to create the following output
<ul class="picture-slides-thumbnails"><li><a href="/common/pictures/1.jpg"><img src="/common/thumbnails/1.jpg" alt="" /></a></li></ul>
My issue is that i current code i have to getMedia uses foreach and as there an "<a href=#>" that also has an image wrapping my image the foreach wouldn't work.What would be the best way to approach this.
Thanks.
1. determine if your property has a value - to avoid a getMedia() error...
<xsl:if test="$currentPage/yourImageAlias != ''">
then create a variable that equals the file path to the image
<xsl:variable name="picFile" select="umbraco.library:GetMedia($currentPage/yourImagePropertyAlias,false)/umbracoFile"/>
finally, set your image source...
<img src="{$picFile}"/>
don't forget to close your if test...
</xsl:if>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
how to use getMedia without a foreach in 4.5
I would like to create the following output
My issue is that i current code i have to getMedia uses foreach and as there an "<a href=#>" that also has an image wrapping my image the foreach wouldn't work.What would be the best way to approach this.
Thanks.
1. determine if your property has a value - to avoid a getMedia() error...
then create a variable that equals the file path to the image
finally, set your image source...
don't forget to close your if test...
</xsl:if>
is working on a reply...