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
    Nov 15, 2010 @ 07:31
    syn-rg
    0

    Thumbnail image from child node image upload

    I'm trying to display a thumbnail image on my parent node of an image I've uploaded to my grandchild node. But so far haven't had any success.
    The alias for the uploaded image is "projectImage" but I'm not sure of the correct code needed to display the thumbnail.
    Can anyone help?

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
      exclude-result-prefixes="msxml
    umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes
    Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings
    Exslt.ExsltSets "
    >

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:template match="/">
    <xsl:value-of select="umbraco.library:RegisterStyleSheetFile('slider1', '/css/project_gallery.css')"/>
      <div id="project_gallery">
    <!-- The fun starts here -->
    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
    <div id="project">

    <!-- get first photo thumbnail -->
        <a href="{umbraco.library:NiceUrl(@id)}">
          <xsl:if test="count(./* [@isDoc]) &gt; 0">
            <img src="{concat(substring-before(./*/umbracoFile,'.'), '_thumb.jpg')}" style="border: none;"/>
          </xsl:if>
          
          <xsl:if test="$currentPage/child::node/projectImage != ''">
            <img alt="">
            <xsl:attribute name="src">
              <xsl:value-of select="$currentPage/child::node/projectImage" />
            </xsl:attribute>   
          </img>
          </xsl:if>
          
          <xsl:if test="completionDate != ''">
            <h1><xsl:value-of select="umbraco.library:FormatDateTime(completionDate, 'MMMM yyyy')"/></h1>
          </xsl:if>
          <xsl:if test="projectClient != ''">
            <h2><xsl:value-of select="projectClient" /></h2>
          </xsl:if>
          <xsl:if test="projectLocation != ''">
            <p><xsl:value-of select="projectLocation" /></p>
          </xsl:if>
        </a>
    </div>

    </xsl:for-each>
        </div>
    </xsl:template>

    </xsl:stylesheet>
  • syn-rg 282 posts 425 karma points
    Nov 15, 2010 @ 23:19
    syn-rg
    0

    Solved it!

    version="1.0" encoding="UTF-8"?>
    DOCTYPE xsl:stylesheet [ ENTITY nbsp " "> ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
      exclude-result-prefixes="msxml
    umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes
    Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings
    Exslt.ExsltSets "
    >

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:template match="/">
    <xsl:value-of select="umbraco.library:RegisterStyleSheetFile('slider1', '/css/project_gallery.css')"/>
      <div id="project_gallery">

    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
    <div id="project">


        <a href="{umbraco.library:NiceUrl(@id)}">
          <xsl:if test="count(./* [@isDoc]) > 0">
            <img src="{concat(substring-before(./*/projectImage,'.'), '_thumb_181.jpg')}" style="border: none;"/>
          xsl:if>    
          <xsl:if test="completionDate != ''">
            <h1><xsl:value-of select="umbraco.library:FormatDateTime(completionDate, 'MMMM yyyy')"/>h1>
          xsl:if>
          <xsl:if test="projectClient != ''">
            <h2><xsl:value-of select="projectClient" />h2>
          xsl:if>
          <xsl:if test="projectLocation != ''">
            <p><xsl:value-of select="projectLocation" />p>
          xsl:if>
        a>
    div>

    xsl:for-each>
        div>
    xsl:template>

    xsl:stylesheet>
Please Sign in or register to post replies

Write your reply to:

Draft