Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • syn-rg 282 posts 425 karma points
    Feb 23, 2012 @ 07:32
    syn-rg
    0

    Displaying thumbnails from child node or grandchild node

    I want to display thumbnails of images either uploaded to the child node or to the child nodes "child node"

    I have a news section and I can upload an image to the "News item" Doctype or if I have multiple images I upload them as child nodes for a slideshow gallery (News image).

    The parent page of the of the "News item" currenly displays a list of the news items including thumbnails of any images uploaded to the news item. I want to be able to display the "News image" (grand child nodes) in this list as well.

    But I can't get the "News image" doctypes image (newsSlideImage) to display. Only the "News item" image "newsImage" will display.

    Any ideas of what I need to change in my code?

    I've tried the following:

    <xsl:choose>
              <xsl:when test="count($currentPage/ancestor-or-self::root//*  [name() = $documentTypeAlias2 and string(umbracoNaviHide) != '1' and @level=5]) &gt; 1">
                  <a href="{umbraco.library:NiceUrl(@id)}" title="TEST">
                    <img src="{concat(substring-before(newsSlideImage,'.'), '_thumb_150.jpg')}"/>
                  </a>
              </xsl:when>
              <xsl:otherwise>
                  <a href="{umbraco.library:NiceUrl(@id)}" title="{newsTitle}">
                    <img src="{concat(substring-before(newsImage,'.'), '_thumb_150.jpg')}"/>
                  </a>
              </xsl:otherwise>
            </xsl:choose>
  • syn-rg 282 posts 425 karma points
    Feb 27, 2012 @ 04:22
    syn-rg
    0

    Solve it:

            <xsl:choose>
              <xsl:when test=".//newsSlideImage != ''">
                <a href="{umbraco.library:NiceUrl(@id)}" title="{newsTitle}">
                  <img src="{concat(substring-before(.//newsSlideImage,'.'), '_thumb_150.jpg')}"/>
                </a>
              </xsl:when>
              <xsl:otherwise>
                <xsl:if test="newsImage != ''">
                  <a href="{umbraco.library:NiceUrl(@id)}" title="{newsTitle}">
                    <img src="{concat(substring-before(newsImage,'.'), '_thumb_150.jpg')}"/>
                  </a>
                </xsl:if>
              </xsl:otherwise>
            </xsl:choose>
Please Sign in or register to post replies

Write your reply to:

Draft