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,
Im having some trouble implementing a default image. Ive had a look over the forum and found a post regarding default.
http://our.umbraco.org/forum/templating/templates-and-document-types/8502-Default-media-if-none-selected
Im using the DAMP for selecting my image, but I cant get the default image to show if a images is not selected.
Any help would be grateful.
Thanks
Martin
<xsl:param name="currentPage"/><xsl:template match="/"><!-- The fun starts here --> <xsl:for-each select="$currentPage [@isDoc and string(umbracoNaviHide) != '1']"> <h3 class="newsHeadline"><xsl:value-of select="@nodeName"/></h3> <xsl:apply-templates select="$currentPage/ourWorkThumb[normalize-space()]" /></xsl:for-each></xsl:template><xsl:template match="ourWorkThumb"> <!--<img class="ourWorkThumb" src="{umbraco.library:GetMedia(., 0)/umbracoFile}" />--> <xsl:choose> <xsl:when test="string($currentPage/ourWorkThumb/data[@alias='ourWorkThumb']) = ''"> <img class="ourWorkThumb" src="{umbraco.library:GetMedia(., false)/umbracoFile}" /> </xsl:when> <xsl:otherwise> <img src="/images/defaultWorkImage.png" /> </xsl:otherwise> </xsl:choose></xsl:template> </xsl:stylesheet>
Hi Martin,
Try changing
<xsl:when test="string($currentPage/ourWorkThumb/data[@alias='ourWorkThumb']) = ''"> <img class="ourWorkThumb" src="{umbraco.library:GetMedia(., false)/umbracoFile}" /> </xsl:when>
to
<xsl:when test="string($currentPage/ourWorkThumb/data[@alias='ourWorkThumb']) != ''"> <img class="ourWorkThumb" src="{umbraco.library:GetMedia(., false)/umbracoFile}" /> </xsl:when>
Note the " != '' " (is not epmty). Basically you got it the other way round.
Gio
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Default Image - Using DAMP
Hi,
Im having some trouble implementing a default image. Ive had a look over the forum and found a post regarding default.
http://our.umbraco.org/forum/templating/templates-and-document-types/8502-Default-media-if-none-selected
Im using the DAMP for selecting my image, but I cant get the default image to show if a images is not selected.
Any help would be grateful.
Thanks
Martin
Hi Martin,
Try changing
to
Note the " != '' " (is not epmty). Basically you got it the other way round.
Gio
is working on a reply...