Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 954 karma points
    May 25, 2011 @ 14:51
    Tom
    0

    Get Large Image Folder From Current Folder..

    Hi guys I'm looping through a list of images.. I have a directory structure like:

    FolderName\

    FolderName\Large\

    I'm trying to loop through the folder and list the small images and provide a link to the large folder with an image with an identical name to the small image

     <xsl:for-each select="umbraco.library:GetMedia(./caseStudyImageFolder, true())/Image">  
                <xsl:if test="position() = 1"><xsl:value-of select="$ulOpen" disable-output-escaping="yes"/></xsl:if>
                <xsl:variable name="picFile" select="umbracoFile"/>
                <xsl:variable name="picW" select="umbracoWidth"/>
                <xsl:variable name="picH" select="umbracoHeight"/>
                <li>
                  <href="/media/{./@id}/large/{./name}.{./type}" class="image-zoom"><img>
                  <xsl:attribute name="src"><xsl:value-of select="$picFile"/></xsl:attribute>  
                  </img></a>
                </li>
                <xsl:if test="position() = last()"><xsl:value-of select="$ulClose" disable-output-escaping="yes"/></xsl:if>
              </xsl:for-each>

     

    Try as I might I can't seem to work out how to map essentially all of the image path of the small image and add large to the file folder.. Just wondering if anyone could suggest something.. i don't really want to be using image gen..

  • Tom 713 posts 954 karma points
    May 25, 2011 @ 14:53
    Tom
    0

     

    Try as I might I can't seem to work out how to map essentially all of the image path of the small image and add large to the file folder.. Just wondering if anyone could suggest something.. i don't really want to be using image gen.. the id of the current looping image doesn't map to the same number generated by umbracoFile

     

    The client doesn't want to pay for image gen.. 

     

  • Tom Fulton 2030 posts 4998 karma points c-trib
    May 25, 2011 @ 15:22
    Tom Fulton
    0

    Hi Tom,

    Is the "Large" folder a folder physically on the disk under each media item (ie /media/xxx/large/xxx.jpg), or is it a single Folder in the Media Library under your "caseStudyImageFolder"?

    -Tom

  • Tom 713 posts 954 karma points
    May 25, 2011 @ 15:27
    Tom
    0

    Hi Tom, thanks for replying! It's a media folder.. is there any way you could suggest a better way of doing a gallery with small and large images in the media without paying for imagegen?

  • Tom Fulton 2030 posts 4998 karma points c-trib
    May 25, 2011 @ 15:32
    Tom Fulton
    2

    Hi Tom,

    I think the Free Version of ImageGen might suffice depending on your needs.

    Another way is that Umbraco generates a thumbnail for you when you upload the media item.  You can control the sizes of the thumbnail by editing the upload datatype (Developer -> Data Types -> Upload).  But if you make a change you need to go through and manually re-save all your media items.  This creates a file in the same folder as the media item called filename_thumb.ext.

    If you decide to keep your current way, something like this could probably work (not tested)

      <xsl:variable name="mediaFolder" select="umbraco.library:GetMedia(./caseStudyImageFolder,true())"/>
      <xsl:for-each select="$mediaFolder/Image">
         ... your stuff ...
        <!-- The large image (image in the Large sub-folder with the same nodeName:-->
        <xsl:value-of select="$mediaFolder/Folder [@nodeName='Large']/Image [@nodeName = current()/@nodeName]/umbracoFile"/>
      </xsl:for-each>

    Hope this helps,
    Tom

  • Tom 713 posts 954 karma points
    May 25, 2011 @ 16:31
    Tom
    0

    LEGEND! Thank you so much tom1 that xslt for the large folder worked perfectly! nice solution setting the media folder then finding the node with the matching node name! that's awesome! Thank you

Please Sign in or register to post replies

Write your reply to:

Draft